MCP-TS-DEMO
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP-TS-DEMO 执行 say hello to 小明"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP-TS-DEMO TypeScript MCP服务案例Demo项目
介绍
基于MCP协议,基于TypeScript语言开发简单实现
支持本地Stdio MCP及远程Streamable HTTP MCP服务
支持AI Agent,如Claude、Cline、LINGMA灵码等MCP智能工具
本项目仅为MCP协议示例项目,可参考项目进行更多开发
更多参考官方文档:https://modelcontextprotocol.io
项目未来会持续迭代更多示例
项目依赖
@modelcontextprotocol/sdk
expressInstall:
// node >= 18
// npm 安装
npm install
// 本地stdio调试启动
npm run start
// 本地http调试启动
npm run start-http
// 构建
npm run build项目目录
├─dist 构建输出目录
├─src 源码目录
├─config 配置文件
├─utils 工具类
└─server server目录
├─stdio.ts 本地Stdio MCP服务
├─http.ts 远程Http MCP服务
└─http_stateful.ts 远程Http MCP有状态服务
└─index.ts 入口文件
├─.env stdio 环境变量
├─.env.http http 环境变量
├─.env.http.stateful http 有状态环境变量
├─tsconfig.json tsconfig文件
└─package.json package.json文件如何运行
本地执行完
npm run start-http命令后,就已经构建了本地stdio文件,及启动了http服务配置AI Agent MCP服务,这里以VSCode LINGMA灵码为例,其他智能工具可参考对应文档进行配置 其中
mcp-ts-stdio-server为stdio服务,mcp-ts-http-server为http服务,注意本地路径args要正确
{
"mcpServers": {
"mcp-ts-stdio-server": {
"command": "node",
"args": [
"/Users/zcy/pjqdyd/mcp-ts-demo/dist/index.js"
],
"env": {
"MCP_SERVER_NAME": "mcp-ts-server",
"MCP_SERVER_VERSION": "1.0.0"
}
},
"mcp-ts-http-server": {
"type": "streamable_http",
"url": "http://localhost:3000/mcp"
}
}
}配置完成后,AI工具将自动连接MCP服务,并识别出服务提供的工具
配置完成,并且AI工具正确连接MCP服务后,即可进行MCP服务工具调用,输入“执行 say hello to 小明”
总结
MCP(模型上下文协议)是一个开源标准,用于将人工智能应用与外部系统连接起来。
MCP协议是一种用于构建智能工具和AI服务的协议,它允许工具和AI服务之间进行交互,并使用MCP协议进行数据传输。
通过MCP,像Claude或ChatGPT这样的AI应用可以连接数据源(如本地文件、数据库)、工具(如搜索引擎、计算器)和工作流程(如专门提示)——使它们能够访问关键信息并执行任务。
更多请参考官方文档:https://modelcontextprotocol.io
License
This project is licensed under the MIT license.
Available Tools
2 toolsTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
Both tools 'say-hello' and 'say-hi' perform essentially the same greeting action with no meaningful distinction, making it impossible for an agent to choose correctly.
Both tool names follow a consistent 'verb-noun' pattern with a hyphen, demonstrating a predictable naming convention.
With only two tools that are semantically identical, the tool count is effectively one duplicated tool, which is too few for a coherent API surface.
The server offers only greeting operations with no other capabilities, leaving the tool surface severely limited and lacking in depth or breadth.
Maintenance
Related MCP Connectors
A TypeScript MCP server for Home Assistant, enabling programmatic management of entities, automati…
A simple Typescript MCP server built using the official MCP Typescript SDK and smithery/cli. This…
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Remote MCP server for supportsheep: run AI interviews and manage support content for your blog.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA demonstration MCP server built in TypeScript that shows how to implement stdio-based communication for integration with MCP clients. Serves as a template for building custom MCP servers with strong typing and maintainability.ISC
- AlicenseBqualityDmaintenanceA demonstration TypeScript MCP server that showcases basic MCP concepts with simple tools (greeting, calculator), text resources, and prompt templates for learning the Model Context Protocol.2MIT
- FlicenseAqualityDmaintenanceA TypeScript MCP server template with Zod validation, dual transport (stdio/HTTP), and modular architecture for building MCP-compatible tools, resources, and prompts.11-
- AlicenseNot gradedqualityDmaintenanceA basic MCP server implementation using Node.js and TypeScript that bridges AI models with external tools and data sources via JSON-RPC.2ISC