Get the FREE Ultimate OpenClaw Setup Guide →

MCP-Chinese-Getting-Started-Guide

Model Context Protocol(MCP) 编程极速入门

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio liaokongvfx-mcp-chinese-getting-started-guide uv run web_search.py

How to use

This MCP server implements a web search tool for use with the MCP ecosystem. It exposes a single tool named web_search that, when invoked, queries an external search API and returns a summarized result set suitable for consumption by clients and LLMs. The server is designed to be run via the uv Python tool manager and can be explored interactively with the MCP Inspector to validate tool availability and behavior. To use it from a client, you start the server process (for example by running uv run web_search.py) and connect an MCP client session over stdio, which allows you to list available tools and call web_search with a query.

Once connected, you can list tools to confirm web_search is registered, then call the tool with a dictionary of arguments, e.g. {"query": "杭州天气"}. The tool will perform an internet search through the external API and return a concatenated summary of results. This setup demonstrates how MCP servers can wire external data sources and services into a standardized tool interface for LLMs and other clients.

How to install

Prerequisites:

  • Python 3.11 or compatible environment
  • uv (the Python project manager) – installed via MCP workflow
  • Access to an internet-enabled environment to reach the web-search API

Step-by-step:

  1. Install Python 3.11+ on your system.

  2. Create a project directory and initialize it with uv as shown: uv init mcp_getting_started cd mcp_getting_started

  3. Create and activate a virtual environment using uv: uv venv source .venv/bin/activate # on Unix-like systems .venv\Scripts\activate.bat # on Windows

  4. Install dependencies for MCP tooling including the MCP CLI and HTTP client: uv add "mcp[cli]" httpx openai

  5. Save the provided web_search.py script (or create your own) in the project root.

  6. Run the MCP server using uv as configured in mcp_config (or follow the example below to test with Inspector): uv run web_search.py

  7. Optionally, use the MCP Inspector to debug and visualize the server: npx -y @modelcontextprotocol/inspector uv run web_search.py

Notes:

  • Ensure you have an API key for the web-search API if required by your chosen tool.
  • The exact Python environment may vary; adapt the activate commands to your shell.

Additional notes

Tips and common issues:

  • If the Inspector cannot connect, verify that the port used by the inspector is not blocked and that the server is running with the expected transport (stdio).
  • When using APIs that require authentication, store keys in environment variables or .env and load them in your script as shown in the example.
  • The web_search tool’s behavior depends on the external API; expect potential cost and rate limits depending on your provider.
  • You can adapt the tool name and arguments by editing the web_search.py file; MCP uses the function name as the tool identifier and the function signature as the argument schema.
  • If you switch transport (e.g., from stdio to SSE), ensure the client and server configurations align with MCP’s transport layer expectations.

Related MCP Servers

Sponsor this space

Reach thousands of developers