What is Tzott apifox mcp demo
环境要求
- NodeJS >= 18
1. 准备 Apifox MCP 服务
1.1 克隆 Apifox MCP 项目
git clone https://github.com/Tzott/apifox-mcp-demo.git
1.2 创建环境变量
cd apifox-mcp-demo
cp .env.example .env
1.3 在 Apifox 客户端中创建一个Access Token ,并写入到 .env 文件中
!图片
!图片
1.4 启动 Apifox MCP 服务
# 如果没有安装 pnpm,可先运行:npm i -g pnpm
pnpm i && pnpm build && pnpm start
1.5 看到启动成功日志
> [email protected] start `/Users/claude-code/apifox-mcp-demo`
> node lib/index.js
SSE endpoint: http://localhost:4444/sse
Message endpoint: http://localhost:4444/messages
HTTP server listening on port 4444
2. 准备 Cursor
2.1 创建一个空白的 Nestjs 项目
npm i -g @nestjs/cli
nest new nest-ai-demo
cd nest-ai-demo
2.2 添加一个 Cursor MCP 配置
从 apifox-mcp-demo
项目中复制 sse 的地址
,填到 Server URL
中。
!图片
可以看到MCP 服务连接成功
!图片
2.3 打开 Cursor Composer,并切换到 Agent 模式
!图片
2.4 复制一个 Apifox 接口的协作链接
!图片
2.5 粘贴到 Composer 中,并让其实现接口
https://app.apifox.com/link/project/5898808/apis/api-263537040
通过这个 Apifox 协作链接,获取其 OpenAPI 的定义,然后根据定义实现这个接口。
注意:技术是:nestjs + typescript,项目我已经搭建了好了,直接实现即可。
2.6 Cursor Composer 实现完毕,并 Accepted 结果
!图片
2.7 启动 Nestjs服务,通过 Apifox 调用AI 写的接口,断言通过
!图片
3. 其他
分页也简单实现了 !图片
Leave a Comment
Frequently Asked Questions
What is MCP?
MCP (Model Context Protocol) is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications, providing a standardized way to connect AI models to different data sources and tools.
What are MCP Servers?
MCP Servers are lightweight programs that expose specific capabilities through the standardized Model Context Protocol. They act as bridges between LLMs like Claude and various data sources or services, allowing secure access to files, databases, APIs, and other resources.
How do MCP Servers work?
MCP Servers follow a client-server architecture where a host application (like Claude Desktop) connects to multiple servers. Each server provides specific functionality through standardized endpoints and protocols, enabling Claude to access data and perform actions through the standardized protocol.
Are MCP Servers secure?
Yes, MCP Servers are designed with security in mind. They run locally with explicit configuration and permissions, require user approval for actions, and include built-in security features to prevent unauthorized access and ensure data privacy.
Related MCP Servers
Brave Search MCP
Integrate Brave Search capabilities into Claude through MCP. Enables real-time web searches with privacy-focused results and comprehensive web coverage.
chrisdoc hevy mcp
sylphlab pdf reader mcp
An MCP server built with Node.js/TypeScript that allows AI agents to securely read PDF files (local or URL) and extract text, metadata, or page counts. Uses pdf-parse.
aashari mcp server atlassian bitbucket
Node.js/TypeScript MCP server for Atlassian Bitbucket. Enables AI systems (LLMs) to interact with workspaces, repositories, and pull requests via tools (list, get, comment, search). Connects AI directly to version control workflows through the standard MCP interface.
aashari mcp server atlassian confluence
Node.js/TypeScript MCP server for Atlassian Confluence. Provides tools enabling AI systems (LLMs) to list/get spaces & pages (content formatted as Markdown) and search via CQL. Connects AI seamlessly to Confluence knowledge bases using the standard MCP interface.
prisma prisma
Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
Zzzccs123 mcp sentry
mcp sentry for typescript sdk
zhuzhoulin dify mcp server
zhongmingyuan mcp my mac
zhixiaoqiang desktop image manager mcp
MCP 服务器,用于管理桌面图片、查看详情、压缩、移动等(完全让Trae实现)
Submit Your MCP Server
Share your MCP server with the community
Submit Now