{"id":22970329,"url":"https://github.com/2013xile/openapi2mcptools","last_synced_at":"2025-04-19T16:20:58.216Z","repository":{"id":267304483,"uuid":"900402336","full_name":"2013xile/openapi2mcptools","owner":"2013xile","description":"OpenAPI specifications =\u003e MCP (Model Context Protocol) tools","archived":false,"fork":false,"pushed_at":"2024-12-09T15:30:42.000Z","size":34,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T10:04:13.181Z","etag":null,"topics":["mcp","mcp-server","mcp-tools","modelcontextprotocol","openapi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/2013xile.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-08T17:26:31.000Z","updated_at":"2025-03-19T09:40:54.000Z","dependencies_parsed_at":"2024-12-09T16:20:57.789Z","dependency_job_id":"c4995eb3-8d1b-4ddc-9b51-0fbd698e3b06","html_url":"https://github.com/2013xile/openapi2mcptools","commit_stats":null,"previous_names":["2013xile/openapi2mcptools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2013xile%2Fopenapi2mcptools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2013xile%2Fopenapi2mcptools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2013xile%2Fopenapi2mcptools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/2013xile%2Fopenapi2mcptools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/2013xile","download_url":"https://codeload.github.com/2013xile/openapi2mcptools/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249736993,"owners_count":21318345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mcp","mcp-server","mcp-tools","modelcontextprotocol","openapi"],"created_at":"2024-12-14T22:12:18.463Z","updated_at":"2025-04-19T16:20:58.179Z","avatar_url":"https://github.com/2013xile.png","language":"TypeScript","funding_links":[],"categories":["🌐 Web Development"],"sub_categories":[],"readme":"# OPENAPI Specifications =\u003e MCP (Model Context Protocol) Tools\n\n- 🔧 An utility library for converting OpenAPI specifications to MCP tools.   \n- 🚀 Faster the development of MCP servers based on OPENAPI specifications.\n\n## Usage\n\n```ts\nimport { Server } from '@modelcontextprotocol/sdk/server/index.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\nimport {\n  CallToolRequestSchema,\n  ListToolsRequestSchema,\n} from '@modelcontextprotocol/sdk/types.js';\nimport { Converter } from 'openapi2mcptools';\n\nconst converter = new Converter({\n  baseURL, // optional\n  httpClient // optional\n});\nawait converter.load({\n  // specs\n});\nconst tools = converter.getToolsList();\nconst toolCaller = converter.getToolsCaller();\n\nconst server = new Server(\n  {\n    name: 'mcp-server-openapi',\n    version: '1.0.0',\n  },\n  {\n    capabilities: {\n      tools: {},\n    },\n  },\n);\n\n// Define available tools\nserver.setRequestHandler(ListToolsRequestSchema, async () =\u003e {\n  return {\n    tools,\n  };\n});\n\n// Handle tool execution\nserver.setRequestHandler(CallToolRequestSchema, async (request) =\u003e {\n  return await toolCaller(request);\n});\n\nconst transport = new StdioServerTransport();\nawait server.connect(transport);\n```\n\n## Custom client\n\nSet `baseURL`, `headers`, etc for http client.\n\n```ts\nexport type RequestConfig = {\n  url?: string;\n  method?: string;\n  headers?: any;\n  params?: any;\n  data?: any;\n}\n\nexport interface HTTPClient {\n  request: (requestConfig: RequestConfig) =\u003e Promise\u003c{ data: any }\u003e;\n}\n```\n\nExample:\n\n```ts\nimport axios from axios;\nimport { Converter } from 'openapi2mcptools';\n\nconst converter = new Converter({\n  httpClient: axios\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2013xile%2Fopenapi2mcptools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F2013xile%2Fopenapi2mcptools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F2013xile%2Fopenapi2mcptools/lists"}