Model Context Protocol(MCP) 编程极速入门
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) 编程极速入门.
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 } )
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!'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.
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.
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.
| Tool | What 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!' |
{
"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.
| Variable | Description | Required |
|---|---|---|
| OPENAI_API_KEY | Credential the server authenticates with. | Yes |
| OPENAI_BASE_URL | Endpoint or connection string the server talks to. | Yes |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.