
TypeScript Prompt MCP Server
Okay, I understand. Here are some pre-defined prompt templates you can use for AI assistants to generate comprehensive plans for TypeScript projects, API architectures, and GitHub workflows. I've included variations and options to make them more flexible. **1. TypeScript Project Plan:** * **Template 1 (General):** ``` Create a comprehensive plan for a TypeScript project named "[Project Name]" that aims to [briefly describe the project's purpose]. The plan should include: * **Project Goals and Objectives:** Clearly defined goals and measurable objectives. * **Technology Stack:** Recommended libraries, frameworks, and tools (e.g., React, Angular, Node.js, Express, testing frameworks, linting tools). Justify each choice. * **Project Structure:** A proposed directory structure and module organization. * **Coding Standards and Conventions:** Guidelines for code style, naming conventions, and documentation. * **Testing Strategy:** A plan for unit, integration, and end-to-end testing. Specify testing frameworks and methodologies. * **Build and Deployment Process:** Steps for building, packaging, and deploying the application. Include CI/CD considerations. * **Dependencies Management:** How dependencies will be managed (e.g., npm, yarn, pnpm). * **Error Handling and Logging:** Strategies for handling errors and logging information. * **Security Considerations:** Potential security vulnerabilities and mitigation strategies. * **Scalability Considerations:** How the application can be scaled to handle increased load. * **Future Enhancements:** Potential future features or improvements. * **Initial Setup Instructions:** Step-by-step instructions for setting up the development environment. The target audience for this project is [describe the target audience, e.g., small businesses, individual users, enterprise clients]. The project should be [describe desired qualities, e.g., maintainable, scalable, performant, secure]. ``` * **Template 2 (Specific Framework):** ``` Develop a detailed plan for a TypeScript project using [Framework Name] (e.g., React, Angular, NestJS) to build [briefly describe the application]. The plan should cover: * **Project Goals and Objectives:** Clearly defined goals and measurable objectives. * **Framework-Specific Architecture:** How to leverage [Framework Name]'s architecture (e.g., components, services, modules) for this project. * **State Management:** Recommended state management solution (e.g., Redux, Zustand, Context API) and justification. * **Routing:** How routing will be implemented (e.g., React Router, Angular Router). * **Data Fetching:** Strategies for fetching data from APIs (e.g., Axios, Fetch API, GraphQL). * **UI Component Library:** Recommended UI component library (e.g., Material UI, Ant Design, Chakra UI) and justification. * **Testing Strategy:** A plan for unit, integration, and end-to-end testing, specific to [Framework Name]. Specify testing frameworks and methodologies (e.g., Jest, Cypress, Testing Library). * **Build and Deployment Process:** Steps for building, packaging, and deploying the application, optimized for [Framework Name]. Include CI/CD considerations. * **Dependencies Management:** How dependencies will be managed (e.g., npm, yarn, pnpm). * **Error Handling and Logging:** Strategies for handling errors and logging information. * **Security Considerations:** Potential security vulnerabilities and mitigation strategies. * **Scalability Considerations:** How the application can be scaled to handle increased load. * **Future Enhancements:** Potential future features or improvements. * **Initial Setup Instructions:** Step-by-step instructions for setting up the development environment. The target audience for this project is [describe the target audience, e.g., small businesses, individual users, enterprise clients]. The project should be [describe desired qualities, e.g., maintainable, scalable, performant, secure]. ``` * **Template 3 (Backend API):** ``` Create a comprehensive plan for a TypeScript backend API project named "[API Name]" that will [briefly describe the API's purpose]. The plan should include: * **API Goals and Objectives:** Clearly defined goals and measurable objectives. * **Technology Stack:** Recommended libraries, frameworks, and tools (e.g., Node.js, Express, NestJS, database, ORM, testing frameworks, linting tools). Justify each choice. * **API Architecture:** A proposed architecture (e.g., REST, GraphQL, gRPC). Explain the chosen architecture's benefits for this project. * **Database Design:** A high-level database schema and data model. Specify the database technology (e.g., PostgreSQL, MongoDB, MySQL). * **Authentication and Authorization:** A plan for securing the API, including authentication and authorization mechanisms (e.g., JWT, OAuth). * **API Documentation:** How the API will be documented (e.g., OpenAPI/Swagger). * **Error Handling and Logging:** Strategies for handling errors and logging information. * **Testing Strategy:** A plan for unit, integration, and end-to-end testing. Specify testing frameworks and methodologies. * **Build and Deployment Process:** Steps for building, packaging, and deploying the API. Include CI/CD considerations. * **Dependencies Management:** How dependencies will be managed (e.g., npm, yarn, pnpm). * **Security Considerations:** Potential security vulnerabilities and mitigation strategies (e.g., input validation, rate limiting). * **Scalability Considerations:** How the API can be scaled to handle increased load (e.g., load balancing, caching). * **Rate Limiting:** A strategy for rate limiting API requests. * **Monitoring and Alerting:** How the API will be monitored and how alerts will be generated. * **Future Enhancements:** Potential future features or improvements. * **Initial Setup Instructions:** Step-by-step instructions for setting up the development environment. The API will be consumed by [describe the consumers of the API, e.g., web applications, mobile apps, other APIs]. The API should be [describe desired qualities, e.g., performant, secure, reliable, well-documented]. ``` **2. API Architecture Plan:** * **Template 1 (General):** ``` Design a robust and scalable API architecture for [briefly describe the application or system the API will support]. The architecture should address the following requirements: * **API Style:** Choose an appropriate API style (e.g., REST, GraphQL, gRPC) and justify the choice based on the project's needs. * **Data Format:** Specify the data format (e.g., JSON, XML, Protocol Buffers). * **Authentication and Authorization:** Describe the authentication and authorization mechanisms (e.g., JWT, OAuth, API keys). Consider different user roles and permissions. * **Rate Limiting:** Implement a rate limiting strategy to prevent abuse and ensure fair usage. * **Versioning:** Plan for API versioning to allow for future changes without breaking existing clients. * **Error Handling:** Define a consistent error handling strategy, including error codes and messages. * **Documentation:** Specify how the API will be documented (e.g., OpenAPI/Swagger, Postman collections). * **Caching:** Implement caching strategies to improve performance and reduce load on the backend. * **Security:** Address common security vulnerabilities, such as injection attacks, cross-site scripting (XSS), and cross-site request forgery (CSRF). * **Scalability:** Design the architecture to be scalable to handle increasing traffic and data volume. Consider load balancing, horizontal scaling, and database optimization. * **Monitoring and Logging:** Implement monitoring and logging to track API performance and identify potential issues. * **Deployment:** Describe the deployment strategy (e.g., cloud-based, on-premise). * **Technology Stack:** Recommend specific technologies and tools for implementing the API (e.g., Node.js, Express, NestJS, databases, message queues). The API will be used by [describe the consumers of the API]. The key performance indicators (KPIs) for the API are [list the KPIs, e.g., response time, error rate, throughput]. ``` * **Template 2 (Microservices):** ``` Design a microservices-based API architecture for [briefly describe the application or system]. The architecture should address the following: * **Service Decomposition:** Identify the key services and their responsibilities. Explain the rationale behind the service decomposition. * **Communication:** Specify the communication protocols between services (e.g., REST, gRPC, message queues). Justify the choice. * **Service Discovery:** Implement a service discovery mechanism to allow services to locate each other. * **API Gateway:** Design an API gateway to handle external requests and route them to the appropriate services. * **Authentication and Authorization:** Implement authentication and authorization across the microservices. * **Data Management:** Describe how data will be managed across the microservices. Consider data consistency and eventual consistency. * **Monitoring and Logging:** Implement centralized monitoring and logging for all microservices. * **Deployment:** Describe the deployment strategy for the microservices (e.g., containers, Kubernetes). * **Fault Tolerance:** Design the architecture to be fault-tolerant and resilient to failures. * **Technology Stack:** Recommend specific technologies and tools for implementing the microservices (e.g., Docker, Kubernetes, message queues, databases). The system will handle [describe the scale and complexity of the system]. The key challenges in this architecture are [list the key challenges, e.g., data consistency, distributed tracing, security]. ``` **3. GitHub Workflow Plan:** * **Template 1 (General):** ``` Create a GitHub workflow plan for a [TypeScript/JavaScript/Python/etc.] project named "[Project Name]". The plan should include: * **Branching Strategy:** Define a branching strategy (e.g., Gitflow, GitHub Flow, Trunk-Based Development). Explain the rationale behind the chosen strategy. * **Pull Request Process:** Describe the pull request process, including code review guidelines and approval requirements. * **Continuous Integration (CI):** Implement CI to automatically build, test, and lint the code on every pull request and push. Specify the CI tools (e.g., GitHub Actions, Jenkins, CircleCI). * **Automated Testing:** Integrate automated testing into the CI pipeline. Specify the testing frameworks and types of tests (e.g., unit tests, integration tests, end-to-end tests). * **Code Linting and Formatting:** Enforce code style and formatting using linters and formatters (e.g., ESLint, Prettier). * **Code Coverage:** Track code coverage to ensure adequate test coverage. * **Continuous Deployment (CD):** Implement CD to automatically deploy the application to production after successful CI. Specify the deployment environment and strategy. * **Release Management:** Define a release management process, including versioning and tagging. * **Issue Tracking:** Use GitHub Issues to track bugs, features, and tasks. * **Security Scanning:** Integrate security scanning tools to identify vulnerabilities in the code and dependencies. * **Documentation Generation:** Automate the generation of documentation from the code. * **Dependency Management:** Automate dependency updates and vulnerability scanning. The project is [describe the project's size and complexity]. The goal of the workflow is to [describe the goals, e.g., improve code quality, automate deployments, reduce errors]. ``` * **Template 2 (GitHub Actions Specific):** ``` Design a GitHub Actions workflow for a [TypeScript/JavaScript/Python/etc.] project named "[Project Name]". The workflow should: * **Trigger:** Specify the triggers for the workflow (e.g., pull requests, pushes to main branch, scheduled events). * **Jobs:** Define the jobs in the workflow, including their dependencies and execution order. * **Steps:** Specify the steps in each job, including the commands to execute and the actions to use. * **Environment Variables:** Use environment variables to configure the workflow. * **Secrets:** Store sensitive information (e.g., API keys, passwords) as secrets. * **Caching:** Use caching to speed up the workflow. * **Artifacts:** Store build artifacts (e.g., compiled code, documentation) for later use. * **Notifications:** Send notifications on workflow completion or failure. * **Error Handling:** Implement error handling to gracefully handle failures. * **Specific Tasks:** Include steps for [list specific tasks, e.g., running unit tests, building the application, deploying to AWS, publishing to npm]. Provide a YAML configuration file for the GitHub Actions workflow. The project is [describe the project's size and complexity]. The goal of the workflow is to [describe the goals, e.g., automate deployments, improve code quality, reduce errors]. ``` **Key Considerations for Using These Templates:** * **Be Specific:** The more specific you are in your prompt, the better the results will be. Provide as much context as possible about the project, its goals, and its requirements. * **Iterate:** Don't expect the AI to generate the perfect plan on the first try. Review the output carefully and iterate on the prompt to refine the plan. * **Customize:** These are just templates. Customize them to fit the specific needs of your project. * **Review and Validate:** Always review and validate the AI-generated plan to ensure that it is accurate, complete, and feasible. Don't blindly trust the AI. * **Consider the AI's Limitations:** AI assistants are good at generating text, but they may not have a deep understanding of software development principles or best practices. Use your own expertise to evaluate the AI's suggestions. By using these templates and following these guidelines, you can effectively leverage AI assistants to generate comprehensive plans for your TypeScript projects, API architectures, and GitHub workflows. Good luck!
README
TypeScript Prompt MCP 服务器
一个模型上下文协议 (MCP) 服务器,为 AI 助手提供预定义的提示模板,允许它们为 TypeScript 项目、API 架构和 GitHub 工作流程生成全面的计划。
🌟 概述
此 MCP 服务器提供了一组提示模板,AI 助手可以使用这些模板为 TypeScript 项目规划生成详细、结构化的响应。它提供以下模板:
- 创建全面的 API 架构计划
- 使用最佳实践设置新的 TypeScript 项目
- 生成 GitHub 工作流程配置
此 MCP 专门设计用于与 Local Dev MCP 配合使用,形成强大的组合,其中 Prompt MCP 生成详细的项目计划,而 Local Dev MCP 执行这些计划。它们共同为 AI 辅助的 TypeScript 项目开发创建无缝的工作流程。
每个提示模板都旨在确保 AI 助手提供一致、高质量且详细的项目计划,并遵循现代 TypeScript 开发标准。
🚀 特性
- 🏗️ API 架构规划: 生成全面的 API 架构计划,包括层、文件夹结构和数据库模式
- 🚀 项目设置: 为新的 TypeScript 项目创建详细的设置计划,包括适当的依赖项和配置
- 🔄 GitHub 工作流程: 设计 GitHub 工作流程计划,包括分支策略、PR 模板和 CI/CD 配置
- 🛠️ 自定义: 每个提示都接受参数,以根据您的特定需求定制生成的计划
- ⚡ 一致的输出: 确保 AI 助手提供遵循最佳实践的结构化、详细的响应
📋 前提条件
- Node.js (v14 或更高版本)
- npm 或 yarn
🔧 安装
-
克隆存储库
git clone <repository-url> cd typescript-prompt-mcp
-
安装依赖项
npm install
-
设置环境变量
# 创建开发环境文件 cp .env.example .env.development # 创建生产环境文件 cp .env.example .env.production
🎮 用法
开发模式
npm run dev
这将在开发模式下启动 MCP 服务器,并启用热重载。
生产模式
npm run build
npm start
或者使用简写:
npm run prod
🔗 与 Local Dev MCP 和 Claude Desktop 集成
要将此 MCP 服务器添加到 Claude Desktop:
-
启动 MCP 服务器 确保您的服务器在本地运行。
-
打开 Claude Desktop 设置
- 启动 Claude Desktop
- 点击右上角的个人资料图片或图标
- 从下拉菜单中选择“设置”
-
导航到扩展设置
- 在设置侧边栏中,点击“扩展”
- 选择“添加自定义 MCP”
4.1 配置 MCP 连接
- 名称:
TypeScript Prompt MCP
(或您喜欢的任何名称) - URL:输入您的 MCP 服务器正在运行的 URL(例如,本地开发为
http://localhost:3000
) - 点击“添加 MCP”
4.2 替代方案:通过命令配置 MCP 连接
- 您首先需要构建项目并提供已编译服务器的完整路径
- 将以下内容添加到您的 Claude Desktop 配置:
"ts-prompts": {
"command": "node",
"args": [
"YOUR_CUSTOM_PATH/dist/index.js"
]
}
-
启用 MCP
- 切换新添加的 MCP 旁边的开关以启用它
- Claude Desktop 将尝试连接到您的 MCP 服务器
-
添加 Local Dev MCP
- 重复步骤 3-5 以将 Local Dev MCP 也添加到 Claude Desktop
- 启用这两个 MCP 可以实现从计划到实施的完整工作流程
-
验证连接
- 与 Claude 开始新的对话
- 要求 Claude 帮助您规划 TypeScript 项目或 API 架构
- Claude 现在应该能够使用提示模板来提供详细的计划
- 然后要求 Claude 使用 Local Dev MCP 实施该计划
与 Claude 的用法示例
连接到两个 MCP 后,您可以要求 Claude:
- “你能帮我为一个名为 'ecommerce-backend' 的 TypeScript 项目规划一个 API 架构,使用 MongoDB 和 JWT 身份验证吗?”(使用此 Prompt MCP)
- “我需要一个使用 React 组件的新 TypeScript 前端库的设置计划”(使用此 Prompt MCP)
- “为我的 TypeScript CLI 项目创建一个 GitHub 工作流程计划,包括自动化测试和 npm 发布”(使用此 Prompt MCP)
- “现在使用 Local Dev MCP 实施我们刚刚计划的 API 项目”(使用 Local Dev MCP)
- “使用我们创建的计划设置 TypeScript 项目”(使用 Local Dev MCP)
这种 MCP 组合创建了一个强大的工作流程,您可以在其中详细规划您的项目,然后在不离开 Claude 界面的情况下实施它。
🧠 可用提示
服务器公开了 AI 助手可以使用的几个提示:
api-architecture
为 TypeScript API 生成全面的架构计划。
参数:
projectName
: API 项目的名称database
: 要使用的数据库 (postgres, mysql, mongodb, etc.)auth
: 身份验证方法 (jwt, oauth, none)endpoints
: 主要 API 端点的逗号分隔列表
new-project-setup
为新的 TypeScript 项目生成全面的设置计划。
参数:
projectName
: 项目的名称projectType
: 项目类型 (api, frontend, library, cli)features
: 以逗号分隔的关键特性或要求
github-workflow
为 TypeScript 项目生成 GitHub 工作流程计划。
参数:
projectName
: 项目的名称ciFeatures
: CI 特性的逗号分隔列表 (lint, test, build, etc.)deployTarget
: 部署目标 (netlify, vercel, aws, azure, etc.)branchStrategy
: 分支策略 (gitflow, trunk, github-flow)
🔍 工作原理
服务器使用 ModelContextProtocol SDK 创建 MCP 服务器:
- 它使用 zod 定义带有参数的结构化提示以进行验证
- 每个提示返回一个格式化的消息,指导 AI 助手生成全面的计划
- 这些提示包括关于计划中应包含内容的详细说明
- 服务器通过传输(通常是 stdio)连接到 Claude 或其他 MCP 兼容的 AI 助手
🛠️ 项目结构
src/
├── index.ts # 设置 MCP 服务器的入口点
├── prompts/ # 提示定义
│ ├── apiArchitecture.ts # API 架构提示
│ ├── githubWorkflow.ts # GitHub 工作流程提示
│ ├── newProjectSetup.ts # 新项目设置提示
│ └── index.ts # 导出所有提示
scripts/
├── prepare-build.ts # 用于准备生产构建的脚本
├── run-relevant-tests.ts # 用于在更改的文件上运行测试的脚本
└── setup-husky.js # 用于设置 Git 钩子的脚本
⚙️ 开发
添加新提示
要添加新的提示模板:
- 在
src/prompts
目录中创建一个新文件 - 使用
mcpServer.prompt()
方法定义您的提示 - 使用 zod 模式添加参数验证
- 在
src/prompts/index.ts
中导出您的提示
示例:
import { z } from 'zod';
import { mcpServer } from '../index';
mcpServer.prompt(
'my-new-prompt',
'此提示作用的描述',
{
param1: z.string().describe('param1 的描述'),
param2: z.number().optional().describe('param2 的描述'),
},
async ({ param1, param2 = 0 }) => {
return {
messages: [
{
role: 'user',
content: {
type: 'text',
text: `您的提示模板,带有 ${param1} 和 ${param2}...`,
},
},
],
};
},
);
环境配置
服务器对开发和生产使用不同的环境文件:
.env.development
- 在开发模式下运行时使用.env.production
- 在生产模式下运行时使用
测试
使用以下命令运行测试套件:
npm test
Linting 和格式化
# 运行 ESLint
npm run lint
# 修复 ESLint 错误
npm run lint:fix
# 使用 Prettier 格式化代码
npm run format
# 检查格式化
npm run format:check
📝 部署注意事项
部署到生产环境时:
- 确保您的
.env.production
文件包含有效的凭据(如果需要) - 构建过程会将这些凭据嵌入到已编译的代码中
- 使用
npm run prod
构建并启动生产服务器
📄 许可证
此项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
作者
Gpaul | Faldin
推荐服务器

Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。