@ivotoby/openapi-mcp-server 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,115 @@
1
+ # OpenAPI MCP Server
2
+
3
+ A Model Context Protocol (MCP) server that exposes OpenAPI endpoints as MCP resources. This server allows Large Language Models to discover and interact with REST APIs defined by OpenAPI specifications through the MCP protocol.
4
+
5
+ ## Quick Start
6
+
7
+ You do not need to clone this repository to use this MCP server. You can simply configure it in Claude Desktop:
8
+
9
+ 1. Locate or create your Claude Desktop configuration file:
10
+ - On macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
11
+
12
+ 2. Add the following configuration to enable the OpenAPI MCP server:
13
+
14
+ ```json
15
+ {
16
+ "mcpServers": {
17
+ "openapi": {
18
+ "command": "npx",
19
+ "args": ["-y", "@ivotoby/openapi-mcp-server"],
20
+ "env": {
21
+ "API_BASE_URL": "https://api.example.com",
22
+ "OPENAPI_SPEC_PATH": "https://api.example.com/openapi.json",
23
+ "API_HEADERS": "Authorization:Bearer token123,X-API-Key:your-api-key"
24
+ }
25
+ }
26
+ }
27
+ }
28
+ ```
29
+
30
+ 3. Replace the environment variables with your actual API configuration:
31
+ - `API_BASE_URL`: The base URL of your API
32
+ - `OPENAPI_SPEC_PATH`: URL or path to your OpenAPI specification
33
+ - `API_HEADERS`: Comma-separated key:value pairs for API authentication headers
34
+
35
+ ## Development Tools
36
+
37
+ This project includes several development tools to make your workflow easier:
38
+
39
+ ### Building
40
+
41
+ - `npm run build` - Builds the TypeScript source
42
+ - `npm run clean` - Removes build artifacts
43
+ - `npm run typecheck` - Runs TypeScript type checking
44
+
45
+ ### Development Mode
46
+
47
+ - `npm run dev` - Watches source files and rebuilds on changes
48
+ - `npm run inspect-watch` - Runs the inspector with auto-reload on changes
49
+
50
+ ### Code Quality
51
+
52
+ - `npm run lint` - Runs ESLint
53
+ - `npm run typecheck` - Verifies TypeScript types
54
+
55
+ ## Configuration
56
+
57
+ The server can be configured through environment variables or command line arguments:
58
+
59
+ ### Environment Variables
60
+
61
+ - `API_BASE_URL` - Base URL for the API endpoints
62
+ - `OPENAPI_SPEC_PATH` - Path or URL to OpenAPI specification
63
+ - `API_HEADERS` - Comma-separated key:value pairs for API headers
64
+ - `SERVER_NAME` - Name for the MCP server (default: "mcp-openapi-server")
65
+ - `SERVER_VERSION` - Version of the server (default: "1.0.0")
66
+
67
+ ### Command Line Arguments
68
+
69
+ ```bash
70
+ npm run inspect -- \
71
+ --api-base-url https://api.example.com \
72
+ --openapi-spec https://api.example.com/openapi.json \
73
+ --headers "Authorization:Bearer token123,X-API-Key:your-api-key" \
74
+ --name "my-mcp-server" \
75
+ --version "1.0.0"
76
+ ```
77
+
78
+ ## Development Workflow
79
+
80
+ 1. Start the development environment:
81
+ ```bash
82
+ npm run inspect-watch
83
+ ```
84
+
85
+ 2. Make changes to the TypeScript files in `src/`
86
+ 3. The server will automatically rebuild and restart
87
+ 4. Use the MCP Inspector UI to test your changes
88
+
89
+ ## Debugging
90
+
91
+ The server outputs debug logs to stderr. To see these logs:
92
+
93
+ 1. In development mode:
94
+ - Logs appear in the terminal running `inspect-watch`
95
+
96
+ 2. When running directly:
97
+ ```bash
98
+ npm run inspect 2>debug.log
99
+ ```
100
+
101
+ ## Contributing
102
+
103
+ 1. Fork the repository
104
+ 2. Create a feature branch
105
+ 3. Make your changes
106
+ 4. Run tests and linting:
107
+ ```bash
108
+ npm run typecheck
109
+ npm run lint
110
+ ```
111
+ 5. Submit a pull request
112
+
113
+ ## License
114
+
115
+ MIT
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "../dist/bundle.js";