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

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

Local serverstdioPython

What is the Model Context Protocol(MCP) 编程极速入门 MCP Server?

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

What you get

async with httpx.AsyncClient() as client: response = await client.post( 'https://open.bigmodel.cn/api/paas/v4/tools', headers={'Authorization': '换成你自己的API KEY'}, json={ 'tool': 'web-search-pro', 'messages': [ {'role': 'user', 'content': query} ], 'stream': False } )

What the assistant can call

Once Model Context Protocol(MCP) 编程极速入门 is connected, these are the calls the assistant has available:

  • Prompt — @app.prompt('翻译专家') async def translate_expert( target_language: str = 'Chinese', ) -> str: return f'你是一个翻译专家,擅长将任何语言翻译成{target_language}。请翻译以下内容:'
  • Resource — @app.resource('echo://static') async def echo_resource(): # 返回的是,当用户使用这个资源时,资源的内容 return 'Echo!'

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
web_search
delete_file
image_generation

How to install the Model Context Protocol(MCP) 编程极速入门 MCP Server

{
  "mcpServers": {
    "web-search-server": {
      "command": "uv",
      "args": [
        "--directory",
        "D:/projects/mcp_getting_started",
        "run",
        "web_search.py"
      ]
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Example prompts to try

  • “Use Model Context Protocol(MCP) 编程极速入门 to Prompt.”
  • “Use Model Context Protocol(MCP) 编程极速入门 to Resource.”

Frequently asked questions

Python 3.11, `uv`, the Python packages `mcp[cli]`, `httpx`, `openai`, and `python-dotenv`. Node.js is also required for the MCP Inspector.