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) 编程极速入门 MCP server exists for a simple reason — assistants are far more useful when they can act on Model Context Protocol(MCP) 编程极速入门 directly instead of describing what you should do. 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!'

Setting it up

The server ships on npm as @modelcontextprotocol/inspector, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

Configuration and credentials

You will need 2 environment variables: OPENAI_API_KEY, OPENAI_BASE_URL. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.

Choosing this one

This sits in the developer tooling group, where several servers overlap in what they claim to do but differ sharply once you actually set them up. Model Context Protocol(MCP) 编程极速入门's toolset — Prompt, Resource — is a fair guide to whether it matches your workflow. It is maintained by liaokongVFX; worth a glance at recent repository activity before you build anything load-bearing on it.

This entry was verified against Model Context Protocol(MCP) 编程极速入门's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • Missing credentials fail quietly in some clients — if no tools show up, check the environment block first.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the model context protocol(mcp) 编程极速入门 mcp server does with a few real requests.

Available tools

ToolWhat it does
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!'

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

{
  "mcpServers": {
    "chinese-getting-started-guide": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/inspector"],
      "env": {
        "OPENAI_API_KEY": "your-value",
        "OPENAI_BASE_URL": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
OPENAI_API_KEYCredential the server authenticates with.Yes
OPENAI_BASE_URLEndpoint or connection string the server talks to.Yes

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.