MCP.so
登录

MCP Server Basic Example

@ugundhar

基本信息

分类

其他

许可证

NOASSERTION

传输方式

stdio

作者

ugundhar

关于 MCP Server Basic Example

complete mcp server

MCP Server Basic Example 配置

使用下面的配置,将此服务器添加到你的 MCP 客户端。

{
  "mcpServers": {
    "mcp-server-ugundhar": {
      "command": "uv",
      "args": [
        "init",
        "mcp-server-basic"
      ]
    }
  }
}

MCP Server Basic Example 工具

工具列表暂未提供

当前收录暂时没有可展示的工具列表,不代表服务没有工具。请查阅项目文档了解支持的能力。

工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。

概览

What is MCP Server Basic Example?

MCP Server Basic Example is a minimal reference implementation of the Model Context Protocol (MCP) server in Python. It demonstrates core MCP capabilities—tools and resources—and is intended for developers learning how to build MCP servers.

How to use MCP Server Basic Example?

Initialize a project with uv init mcp-server-basic, create a virtual environment, and install mcp[cli]. Run the server for inspection with uv run mcp dev main.py, or normally with uv run mcp run. To install in Claude Desktop, use uv run mcp install main.py. For VS Code, run uv run main.py then open the chat with Ctrl+Shift+I.

Key features of MCP Server Basic Example

  • add(a, b) tool: adds two integers
  • subtract(a, b) tool: subtracts second integer from first
  • greeting://{name} resource: returns a personalized greeting
  • Fully compatible with MCP Inspector and Claude Desktop
  • Minimal Python implementation using uv as package manager

Use cases of MCP Server Basic Example

  • Learning how to implement MCP tools and resources from scratch
  • Testing MCP client‑server communication with the Inspector
  • Bootstrapping a custom MCP server for simple arithmetic or greeting functions
  • Integrating with Claude Desktop for demonstration purposes

常见问题

1

What tools does the server provide?

The server exposes two integer arithmetic tools: `add(a, b)` and `subtract(a, b)`.

2

What resources does the server provide?

It provides a single dynamic resource `greeting://{name}` that returns a personalized greeting string.

3

How do I run the server in development mode?

Use `uv run mcp dev main.py` to launch the server with the MCP Inspector for testing and debugging.

4

How do I install the server in Claude Desktop?

Run `uv run mcp install main.py` from the project directory to register the server with Claude Desktop.

5

How do I connect the server in VS Code?

Open the project folder in VS Code, run `uv run main.py` in the terminal, then press Ctrl+Shift+I to launch the VS Code chat interface and configure the MCP connection.

评论

其他 分类下的更多 MCP 服务器