mcpField
M
Mcp_server

Mcp_server

Local
github.com/hfhfnDeveloper Tools5Updated 35w ago

About Mcp_server

Mcp_server is a reference for running and configuring Python MCP services. It covers uv and uvx startup commands, plus client setup for stdio, SSE, and Streamable HTTP transports.

Key features

  1. 01Run Python services with uv
  2. 02Launch service scripts with uvx
  3. 03SSE and HTTP endpoint examples
  4. 04Examples for multiple transports
  5. 05stdio startup parameters

Use cases

  1. 01Start an MCP service with uv or uvx
  2. 02Set up a client's stdio connection
  3. 03Configure SSE or Streamable HTTP endpoints

MCP support

The project documents how to run MCP services and configure client connections over stdio, SSE, and Streamable HTTP.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README
使用uv管理python环境
  • uv启动mcp服务的python脚本
uv run --with mcp[cli] mcp run path/to/mcp.py
  • uvx启动mcp服务的python脚本
uvx --with pillow --with mcp[cli] fastmcp run path/to/mcp.py
启动单个mcp服务 sse和streamable-http两种模式的URL路径
# sse 模式
http://127.0.0.1:8000/sse  # 默认8000端口
http://host.docker.internal:8000/sse  # docker容器内访问
# streamable-http 模式
http://127.0.0.1:8000/mcp  # 默认8000端口
http://host.docker.internal:8000/mcp  # docker容器内访问
使用mcp工具的多种基本配置示例参考:
// 涉及3种模式:stdio,sse,streamable_http
{
  // streamable_http模式
  "mcpServers": {
    "math": {
      "transport": "streamable_http",
      "url": "http://127.0.0.1:8000/mcp"
    },
    // sse模式
    "weather": {
      "transport": "sse",
      "url": "http://127.0.0.1:8000/sse"
    },
    "12306-mcp": {
      "type": "sse",
      "url": "https://mcp.api-inference.modelscope.cn/sse/76ee2dbba8d74f"
    },
    "sequentialthinking": {
      "headers": {
        "Accept": "application/json, text/event-stream",
        "Authorization": "Bearer 0e51a8cd-e77f-072ec3f3d161"
      },
      "url": "https://mcp.api-inference.modelscope.cn/sse/bb19488b5bc049"
    },
    // 本地服务 stdio模式
    "quickchart-server": {
      "isActive": true,
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "-y",
        "@gongrzhe/quickchart-mcp-server"
      ],
      "name": "quickchart-server"
    },
    "excel-mcp-server": {
      "isActive": true,
      "command": "cmd",
      "args": [
        "/c",
        "npx",
        "--yes",
        "@zhiweixu/excel-mcp-server"
      ],
      "env": {
        "LOG_PATH": "C:\\Users\\username\\Desktop\\temp",
        "CACHE_MAX_AGE": "1",
        "CACHE_CLEANUP_INTERVAL": "4",
        "LOG_RETENTION_DAYS": "7",
        "LOG_CLEANUP_INTERVAL": "24"
      },
      "name": "excel-mcp-server"
    }
  }
}

STDIO 模式启动说明

如果需要在客户端以 stdio 模式启动本项目:

  1. 环境准备: 在项目根目录下运行以下命令,安装 MCP 命令行工具:
uv add "mcp[cli]"
  1. 启动配置: 在配置客户端时,使用 uv 作为命令,并配合 --directory 参数指定项目路径。
    • 命令: uv
    • 参数: ["--directory", "/Users/hfhfn/charmProjects/mcp_server/", "run", "main.py"]

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.