Content
# MCP Builder
This project is designed to convert OpenAPI specifications into TypeScript code and generate MCP Server. It provides a simple way to generate TypeScript schemas and handlers based on the definitions provided in an OpenAPI YAML file.
> This project works with OpenAPI v3, to convert v2 to v3 check this doc: [openapi3-parser](https://github.com/manchenkoff/openapi3-parser/blob/master/docs/recipes.md)
## Generate Code
To run the project, activate venv:
```bash
uv venv --python 3.12.9
source .venv/bin/activate
uv install
```
Then, you can run the generator script to convert your OpenAPI YAML file into TypeScript code. The command below assumes you have an OpenAPI YAML file named `example/openapi_v3.yaml` and you want to generate a TypeScript files in `output` directory, using the templates located in the `src/templates` directory.
```bash
python -m src.main --input=example/openapi_v3.yaml --output_dir=output --templates_dir=src/templates
```
or
```bash
make run
```
## Prepare MCP Server
change directory to `output`,create `.env` file and put your envs there, then run:
```bash
npm i
```
### Check server
run `node dist/server.js`. you shuold see the starting message. (MCP Server running ...)
## Use MCP Server
### VsCode
Create `.vscode` folder in root of your project and create `mcp.json` file.
```json
{
"servers": {
"gitlab": {
"command": "node",
"args": [
"/path/to/mcp_builder/output/dist/server.js" ## Change this base on your path
],
"env": {
"ACCESS_TOKEN": "ss", ## change it
"API_URL": "ss" ## change it
},
"type": "stdio"
}
}
}
```
### Cline
find `cline_mcp_settings.json` in your device and add this:
```json
{
"mcpServers": {
"gitlab": {
"disabled": false,
"timeout": 60,
"command": "node",
"args": [
"/path/to/mcp_builder/output/dist/server.js" ## Change this base on your path
],
"env": {
"ACCESS_TOKEN": "ss", ## change it
"API_URL": "ss" ## change it
},
"transportType": "stdio"
}
}
}
```
> If more than about 50 tools are generated, they are not shown in the Cline list. you can filter list in `src/templates/server.ts.j2` and generate it again:
```typescript
...
server.setRequestHandler(ListToolsRequestSchema, async () => {
return {
tools: Object.entries(toolStore).slice(0,50).map(([name, tool]) => ({
name,
description: tool.definition.description,
inputSchema: tool.definition.inputSchema,
})),
};
});
...
```
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
everything-claude-code
Complete Claude Code configuration collection - agents, skills, hooks,...
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.