MCP Starter

by instructa
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides linkage to the author's Bluesky profile (@kevinkern.dev) for social connectivity

  • References the author's other GitHub projects that users might find relevant

  • Mentioned in relation to the author's AI Prompts project, suggesting compatibility or relevance with GitHub Copilot

MCP 服务器启动器

想要构建自己的 MCP 服务器吗?

MCP Server Starter 为您提供了一个基本结构,以便使用 MCP 标准运行 Cursor、Claude 和其他本地工具。


特征

  • 📡灵活的沟通方式
    • 支持客户端与服务器之间的多种通信协议,
    • stdio :本地使用
    • Streamable HTTP :远程和本地使用
    • sse :远程和本地使用(已弃用)~~
  • 📦最小设置- 通过基本的服务器实现快速开始。
  • 🤖 Cursor AI 集成- 包括示例.cursor/mcp.json配置。
  • ⌨️ TypeScript - 为您的项目添加类型安全。

待办事项

  • [ ] 添加发布您自己的包的选项
  • [ ] 更好地支持脚手架 CLI
  • [ ] 提示动态构建工具

入门

先决条件

  • Node.js (如有必要请指定版本)
  • 与 MCP 兼容的客户端(例如Cursor

用法

支持的传输选项

模型上下文协议支持多种传输方式。

标准输入输出

推荐用于本地设置

代码编辑器支持

添加下面的代码片段

  • 游标: .cursor/mcp.json

本地开发/测试

如果您想在本地测试您的 mcp 服务器,请使用此选项

{ "mcpServers": { "my-starter-mcp-stdio": { "command": "node", "args": ["./bin/cli.mjs", "--stdio"] } } }

已发布的包

当你在 npm 注册表中发布你的包时使用

{ "mcpServers": { "my-starter-mcp-stdio": { "command": "npx", "args": ["my-mcp-server", "--stdio"] } } }

可流式传输的 HTTP

重要提示:Cursor 尚不支持 Streamable HTTP

推荐用于远程服务器

**重要提示:**与 stdio 不同,您还需要使用正确的标志运行服务器

本地开发使用streamable http传输

  1. 启动 MCP 服务器 在终端中运行此命令
node ./bin/cli.mjs --http --port 4200

或者使用 mcp 检查器

npm run dev-http # npm run dev-sse (deprecated)
  1. 将其添加到您的配置中
{ "mcpServers": { "my-starter-mcp-http": { "command": "node", "args": ["./bin/cli.mjs", "--http", "--port", "4001"] // "args": ["./bin/cli.mjs", "--sse", "--port", "4002"] (or deprecated sse usage) } } }

已发布的包

当你在 npm 注册表中发布你的包时使用

在你的终端中运行这个

npx my-mcp-server --http --port 4200 # npx my-mcp-server --sse --port 4201 (deprecated)
{ "mcpServers": { "my-starter-mcp-http": { "url": "http://localhost:4200/mcp" // "url": "http://localhost:4201/sse" } } }

使用检查器

使用inspect命令调试你的 mcp 服务器

命令行选项

协议选择

协议描述旗帜笔记
stdio标准 I/O(没有任何)默认
httpHTTP REST--port <num> (默认值:3000), --endpoint <path> (默认值: /mcp
sse服务器发送事件--port <num> (默认值:3000)已弃用

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。


链接

课程

查看我的其他项目:

  • AI 提示- 为 Cursor AI、Cline、Windsurf 和 Github Copilot 精心策划的 AI 提示
  • codefetch - 使用一个简单的终端命令将代码转换为 LLM 的 Markdown
  • aidex一个 CLI 工具,提供有关 AI 语言模型的详细信息,帮助开发人员根据自己的需求选择正确的模型。# mcp-starter

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

用于构建自定义本地模型上下文协议 (MCP) 服务器的基础,该服务器提供可供 Cursor 或 Claude Desktop 等 AI 助手访问的工具。

  1. Features
    1. Todo
      1. Getting Started
        1. Prerequisites
      2. Usage
        1. Supported Transport Options
        2. stdio
        3. Streamable HTTP
      3. Use the Inspector
        1. Command-Line Options
          1. Protocol Selection
        2. License
          1. Links
            1. Courses
              1. See my other projects:
                ID: uh9fbrnkxd