my-mcp-server
my-mcp-server
一个使用 TypeScript 构建 MCP (Model Context Protocol) 服务器的游乐场和实验项目。它演示了如何通过 stdio 传输向 AI 代理和语言模型暴露 工具 和 资源。
该服务器管理一个简单的用户数据库(以本地 JSON 文件为后端),并暴露 AI 代理可以调用以读取或创建用户记录的端点。
功能特性
工具 —
my-create-tool:通过接受name、address、email和phone字段创建新用户,并将记录持久化到src/users.json。资源 —
users://all:以 JSON 形式返回模拟数据库中的完整用户列表。资源 —
users://{userId}/profile:返回由userId标识的单个用户的个人资料。
Related MCP server: FastMCP Example Server
先决条件
安装
npm install运行服务器
开发模式(使用 tsx,无需构建步骤)
npm run server:dev构建并运行编译输出
npm run server:build # compiles TypeScript → JavaScript
node dist/server.js # run the compiled server监视模式(更改时自动重新编译)
npm run server:build:watch使用 MCP Inspector UI 进行检查
MCP Inspector 允许您在浏览器 UI 中交互式调用工具并浏览资源:
npm run server:inspect注意:
server:inspect设置DANGEROUSLY_OMIT_AUTH=true— 仅用于本地开发。
在代理环境中加载 MCP 服务器
代理 CLI(例如 Claude Code CLI)
代理应能检测到 .mcp.json 的存在并提示加载服务器。否则,它是一个简单的 MCP 服务器配置,需要与其他服务器一起添加到配置中。
项目结构
my-mcp-server/
├── src/
│ ├── server.ts # MCP server entry point (tools & resources)
│ └── users.json # Mock user database (read/written at runtime)
├── package.json
└── tsconfig.json技术栈
包 | 角色 |
| MCP 服务器 SDK(工具、资源、stdio 传输) |
| 工具输入模式验证 |
| 无需构建步骤直接运行 TypeScript |
| TypeScript 编译器 |
| 基于浏览器的 MCP 调试 UI |
许可证
ISC
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA lightweight MCP server that connects a local AI model (Ollama) with custom CRUD tools for an in-memory database, enabling natural language database management.
- FlicenseNot gradedqualityDmaintenanceEducational example of an MCP server built with FastMCP, demonstrating how to expose tools, resources, and prompts for AI clients.
- FlicenseNot gradedqualityDmaintenanceExample MCP server built with FastMCP, demonstrating tools, resources, and prompts for AI integration.12
- FlicenseNot gradedqualityCmaintenanceA demonstrative MCP server that exposes a query-user tool for retrieving user info by ID, integrated with LangChain for agent-driven model reasoning and tool calls.
Related MCP Connectors
MCP server exposing the Backtest360 engine API as tools for AI agents.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sp-acc/my-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server