English | 简体中文
Swiftcode MCP Server is a server based on the Model Context Protocol (MCP), focusing on automated code generation to support modern web development workflows. It can automatically generate TypeScript API clients from Swagger/OpenAPI specifications and quickly generate Vue list page components based on templates, greatly improving frontend and backend development efficiency.
- Swagger/OpenAPI to TypeScript: Automatically generate TypeScript API clients and type definitions.
- Vue Component Generation: One-click generation of Vue 3 list pages with tables, filters, and pagination.
- Template Management: Obtain and use built-in code generation templates.
- Specification Validation: Supports Swagger/OpenAPI validation.
- Mock Data Generation: Optionally generate mock data for frontend development.
- Frontend: Vue 3 (Composition API), Element Plus, TypeScript
- API Specification: Swagger 2.0, OpenAPI 3.0+ (JSON/YAML)
- Code Generation: TypeScript interfaces/types, Vue 3 components, Element Plus forms and tables
Generate TypeScript API client from Swagger/OpenAPI specification.
Parameters:
source
(string): Swagger/OpenAPI file path or URLdir
(string): Output directory
Example:
{
"source": "/mock/swagger.json",
"dir": "./"
}
Download and generate SFC/Vue list template files to the specified directory.
Parameters:
dir
(string): Output directory
Example:
{
"dir": "./"
}
Generate Vue list components based on template files.
Parameters:
source
(string): Template file pathdir
(string): Output directory
Example:
{
"source": "template.js",
"dir": "./"
}
Start as an MCP Server:
{
"mcpServers": {
"swiftcode-npm": {
"command": "npx",
"args": ["-y", "@swiftcode/mcp"]
}
}
}
pnpm install
# Build MCP
pnpm build
# Start MCP inspector
pnpm inspector
Start as an MCP Server:
{
"mcpServers": {
// Local development
"swiftcode-local": {
"command": "node",
"args": ["swiftcode-mcp-server/dist/index.js"]
}
}
}
docker build -t swiftcode-mcp .
docker run -it swiftcode-mcp
{
"source": "/user/swagger.json",
"dir": "./"
}
{
"source": "template.js",
"dir": "./"
}
- Fork this repository
- Create a feature branch
- Commit your changes
- Add tests if necessary
- Submit a Pull Request
MIT
For more help or questions, please visit the GitHub.