MCP Server Template
MCP 服务器模板🛠️
用于构建您自己的模型上下文协议 (MCP) 服务器的入门模板。此模板提供了创建可与 Cursor 或 Claude Desktop 配合使用的自定义 MCP 所需的基本结构和设置。
特征
使用 TypeScript 设置基本的 MCP 服务器
示例工具实现
即用型项目结构
Related MCP server: Python MCP Server Template
项目结构
mcp-server-template/
├── index.ts # Main server implementation
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
└── build/ # Compiled JavaScript output入门
克隆此模板:
git clone [your-repo-url] my-mcp-server
cd my-mcp-server安装依赖项:
pnpm install构建项目:
pnpm run build这将生成/build/index.js文件 - 已编译的 MCP 服务器脚本。
与游标一起使用
前往“光标设置”->“MCP”->“添加新的 MCP 服务器”
配置您的 MCP:
姓名:[选择您自己的名字]
类型:命令
命令:
node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js
与 Claude Desktop 一起使用
将以下 MCP 配置添加到您的 Claude Desktop 配置中:
{
"mcpServers": {
"your-mcp-name": {
"command": "node",
"args": ["ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js"]
}
}
}发展
该模板在index.ts中包含一个示例工具实现。要创建您自己的 MCP,请执行以下操作:
修改
index.ts中的服务器配置:
const server = new McpServer({
name: "your-mcp-name",
version: "0.0.1",
});使用
server.tool()方法定义您的自定义工具:
server.tool(
"your-tool-name",
"Your tool description",
{
// Define your tool's parameters using Zod schema
parameter: z.string().describe("Parameter description"),
},
async ({ parameter }) => {
// Implement your tool's logic here
return {
content: [
{
type: "text",
text: "Your tool's response",
},
],
};
}
);构建并测试您的实现:
npm run build贡献
请随时提交问题和增强请求!
执照
麻省理工学院
Available Tools
1 toolsample-toolC
A sample tool for demonstration purposes
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | Input parameter for the sample tool |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description provides zero behavioral information beyond the name. With no annotations provided, the description carries the full burden of disclosing behavioral traits like whether this is a read or write operation, what side effects it might have, authentication requirements, or rate limits. The description fails to address any of these aspects, leaving the agent completely in the dark about how this tool behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise at just one sentence with no wasted words. It's appropriately sized for what little information it conveys, and while it's under-specified, it's not verbose or poorly structured. Every word in 'A sample tool for demonstration purposes' serves its purpose within the minimal context provided.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that this is a tool with one parameter, no annotations, no output schema, and no sibling tools, the description is incomplete. It fails to explain what the tool actually does, what behavior to expect, or what context it operates in. While the simplicity of the tool might lower expectations, the description doesn't provide enough information for an agent to understand when and how to use it effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 100% schema description coverage and only one parameter documented in the schema, the description adds no additional parameter information. The schema already describes the 'input' parameter as 'Input parameter for the sample tool,' so the description doesn't compensate or add meaning beyond what's in the structured data. This meets the baseline of 3 when schema coverage is high.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'A sample tool for demonstration purposes' is a tautology that essentially restates the tool name 'sample-tool' without specifying what it actually does. It doesn't mention any specific verb or resource, nor does it explain what kind of demonstration it performs. While it's not misleading, it provides minimal functional information beyond the name itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool, what context it's appropriate for, or what alternatives might exist. With no sibling tools mentioned, there's no need for differentiation, but the description fails to establish any usage context whatsoever. It doesn't indicate whether this is for testing, learning, or any specific scenario.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
- First observed
sample-tool
TDQS
With only one tool, there is no possibility of ambiguity or overlap between tools, as there are no other tools to confuse it with. The single tool's purpose is clearly distinct by default in this minimal set.
The tool name 'sample-tool' uses a consistent hyphenated noun pattern, and with only one tool, there is no inconsistency to evaluate. The naming is straightforward and follows a simple convention.
A single tool is too few for most practical server purposes, as it severely limits functionality and scope. This feels thin and inadequate for handling any meaningful domain or workflow beyond basic demonstration.
The server is severely incomplete, with only a sample tool that lacks any clear domain or operational coverage. There are obvious gaps, as no CRUD, lifecycle, or specific functionality is provided, making it impossible for agents to perform useful tasks.
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 Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
The Telnyx MCP server is an official implementation of the Model Context Protocol that enables AI clients (like Claude Desktop, Cursor, and OpenAI Agents) to interact with Telnyx's telephony, messaging, and AI assistant APIs. It provides comprehensive capabilities including making and managing phone calls, sending SMS/MMS messages, purchasing and configuring phone numbers, creating AI assistants with custom instructions, managing cloud storage buckets, scraping and embedding website content, and handling integration secrets. The server exists as both a local implementation and a remotely hosted version, allowing developers to integrate real-world communication infrastructure directly into AI applications.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA starter template for building Model Context Protocol (MCP) servers, enabling developers to create and add custom tools that can be integrated with Claude Desktop.2-
- AlicenseDqualityCmaintenanceA template repository for creating custom Model Context Protocol (MCP) servers in Python that can be integrated with applications like Claude Desktop or Cursor.36MIT
- FlicenseBqualityDmaintenanceA starter template for building Model Context Protocol servers that can integrate AI assistants with custom tools, resource providers, and prompt templates.18141-
- FlicenseCqualityDmaintenanceA starter template for building Model Context Protocol servers that integrate with AI assistants like Claude and Cursor, providing custom tools, resource providers, and prompt templates.28-
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/hypermodel-labs/mcp-server-template'
If you have feedback or need assistance with the MCP directory API, please join our Discord server