
Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
mcpdotdirect/template-mcp-server - кандидат на сервер MCP, импортированный из https://github.com/mcpdotdirect/template-mcp-server.
Обзор
mcpdotdirect/template-mcp-server - кандидат на сервер MCP, импортированный из https://github.com/mcpdotdirect/template-mcp-server.
Обзор (машинный перевод)
Инструмент CLI для быстрого создания собственного сервера MCP (Model Context Protocol) с использованием FastMCP
Использование
s Что включено
Шаблон включает:
- Базовая настройка сервера как на стрио, так и на HTTP с использованием FastMCP Структура для определения инструментов, ресурсов и подсказок MCP
- конфигурация TypeScript
- Скрипты разработки и конфигурация
Feature Особенности
- FastMCP: Создан с использованием фреймворка FastMCP для более простой реализации ** Поддержка двойного транспорта**: запустите MCP-сервер через stdio или HTTP TypeScript: полная поддержка TypeScript ** Расширяемый **: Легко добавлять пользовательские инструменты, ресурсы и подсказки
Начало работы
После создания вашего проекта:
1.Установите зависимости с помощью предпочтительного менеджера пакетов:
2.Запустите сервер:
- Для разработки с автозагрузкой:
**Примечание: скрипты по умолчанию в package.json используют Bun в качестве среды выполнения (например, bun run src/index.ts). Если вы предпочитаете использовать другой менеджер пакетов или время выполнения, вы можете изменить эти скрипты в файле package.json, чтобы использовать Node.js или другое время выполнения по вашему выбору.
Detail Подробное использование
Транспортные средства
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
@mcpdotdirect/template-mcp-server
A CLI tool to quickly get started building your very own MCP (Model Context Protocol) server using FastMCP
📋 Usage
# with npx
npx @mcpdotdirect/create-mcp-server
# Or with npm
npm init @mcpdotdirect/mcp-server
🔭 What’s Included
The template includes:
- Basic server setup with both stdio and HTTP transport options using FastMCP
- Structure for defining MCP tools, resources, and prompts
- TypeScript configuration
- Development scripts and configuration
✨ Features
- FastMCP: Built using the FastMCP framework for simpler implementation
- Dual Transport Support: Run your MCP server over stdio or HTTP
- TypeScript: Full TypeScript support for type safety
- Extensible: Easy to add custom tools, resources, and prompts
🚀 Getting Started
After creating your project:
-
Install dependencies using your preferred package manager:
# Using npm npm install # Using yarn yarn # Using pnpm pnpm install # Using bun bun install -
Start the server:
# Start the stdio server npm start # Or start the HTTP server npm run start:http -
For development with auto-reload:
# Development mode with stdio npm run dev # Development mode with HTTP npm run dev:http
Note: The default scripts in package.json use Bun as the runtime (e.g.,
bun run src/index.ts). If you prefer to use a different package manager or runtime, you can modify these scripts in your package.json file to use Node.js or another runtime of your choice.
📖 Detailed Usage
Transport Methods
The MCP server supports two transport methods:
-
stdio Transport (Command Line Mode):
- Runs on your local machine
- Managed automatically by Cursor
- Communicates directly via
stdout - Only accessible by you locally
- Ideal for personal development and tools
-
SSE Transport (HTTP Web Mode):
- Can run locally or remotely
- Managed and run by you
- Communicates over the network
- Can be shared across machines
- Ideal for team collaboration and shared tools
Running the Server Locally
stdio Transport (CLI Mode)
Start the server in stdio mode for CLI tools:
# Start the stdio server
npm start
# or with other package managers
yarn start
pnpm start
bun start
# Start the server in development mode with auto-reload
npm run dev
# or
yarn dev
pnpm dev
bun dev
HTTP Transport (Web Mode)
Start the server in HTTP mode for web applications:
# Start the HTTP server
npm run start:http
# or
yarn start:http
pnpm start:http
bun start:http
# Start the HTTP server in development mode with auto-reload
npm run dev:http
# or
yarn dev:http
pnpm dev:http
bun dev:http
Установка
npx @mcpdotdirect/create-mcp-serverКонфигурация
{
"mcpServers": {
"my-mcp-stdio": {
"command": "npm",
"args": [
"start"
],
"env": {
"NODE_ENV": "development"
}
},
"my-mcp-sse": {
"url": "http://localhost:3001/sse"
}
}
}