๐ Create New MCP Server for data.go.kr API โ
I'll help you create a new MCP server. Please paste the API documentation, and I'll extract all necessary information and guide you through the implementation.
๐ Required Input โ
1. API Documentation (paste everything) โ
Please provide comprehensive API documentation that includes:
Essential Information: โ
- API ์๋น์ค๋ช (Korean/English name)
- Base URL or endpoint URL (e.g.,
https://api.odcloud.kr/api/...) - ์ธ์ฆ ๋ฐฉ์:
- API key parameter name (e.g.,
serviceKey,ServiceKey,apiKey) - Where it goes: URL parameter or header?
- Response format: JSON or XML (default: JSON)
- API key parameter name (e.g.,
Endpoint Details (for each endpoint): โ
- HTTP Method: GET or POST
- Endpoint path:
/validate,/status,/searchetc. - Request parameters:
- Required fields with types
- Optional fields with defaults
- Field constraints (max length, format, etc.)
- Korean field names and descriptions
- Request body format (for POST):
- JSON structure
- Array or single object
- Max items per request (e.g., 100 items)
- Response structure:
- Success response format
- Error response format
- Status codes and meanings
- Data field names and types
API Constraints: โ
- Rate limits (requests per second/minute)
- Max items per request
- Pagination support (page, perPage, etc.)
- Special requirements (date formats, encoding, etc.)
2. Usage Examples (ํ์) โ
Provide 2-3 concrete examples of how this API will be used:
Example 1: "์ฌ์
์๋ฑ๋ก๋ฒํธ 123-45-67890์ด 2020๋
1์ 1์ผ์ ํ๊ธธ๋ ๋ํ๋ก ๊ฐ์
ํ ๊ฒ์ด ๋ง๋์ง ํ์ธํด์ค"
Expected: validate_business tool validates the business registration
Example 2: "์์ธ์ ๊ฐ๋จ๊ตฌ์ ์ค์๊ฐ ๋๊ธฐ์ง ์ ๋ณด๋ฅผ ์๋ ค์ค"
Expected: get_air_quality tool returns PM10, PM2.5 levels
Example 3: "๋ถ์ฐ์์ ์์ธ๋ก ๊ฐ๋ KTX ์๊ฐํ ์กฐํ"
Expected: search_train_schedule tool returns departure times and availability3. Sample API Request/Response (์ค์ ๋ฐ์ดํฐ) โ
Include actual API call examples:
// Request
POST https://api.example.kr/v1/validate
{
"businesses": [{
"b_no": "1234567890",
"start_dt": "20200101",
"p_nm": "ํ๊ธธ๋"
}]
}
// Response
{
"status_code": "OK",
"data": [{
"b_no": "1234567890",
"valid": "01",
"valid_msg": "์ผ์น"
}]
}๐ค What I'll Do Automatically โ
Based on your input, I will:
Auto-generate Names: โ
- API name (kebab-case): Derived from service name
- Package name:
data-go-mcp.\{api-name\} - Module name:
data_go_mcp.\{api_name_underscore\} - Environment variable:
\{API_NAME\}_API_KEY - Display names: Korean and English versions
Analyze and Extract: โ
- Parse all endpoints and their methods
- Identify required vs optional parameters
- Map Korean fields to English variable names
- Determine response data structures
- Extract validation rules and constraints
๐ ๏ธ Detailed Implementation Steps โ
Phase 1: Project Generation โ
- [ ] Create project from template using cookiecutter:bash
uv run cookiecutter template/ -o src/ - [ ] When prompted, enter:
- api_name: {kebab-case-name}
- service_name_korean: {Korean service name}
- service_name_english: {English service name}
- package_name: data-go-mcp.{api-name}
- module_name: data_go_mcp.{api_name_underscore}
- api_key_env: {API_NAME}_API_KEY
- author_name: DataGo MCP
- author_email: contact@datago-mcp.dev
- [ ] Set up correct directory structure
- [ ] Configure pyproject.toml with dependencies
Phase 2: API Client (api_client.py) โ
- [ ] Implement base request method with proper auth
- [ ] Handle GET vs POST based on your documentation
- [ ] Add methods for each endpoint:python
async def {endpoint_name}(self, **params) -> Response - [ ] Implement error handling for API-specific codes
- [ ] Add request validation and formatting
Phase 3: Data Models (models.py) โ
- [ ] Create Pydantic models for:
- [ ] Each request type
- [ ] Each response type
- [ ] Nested data structures
- [ ] Add field validators for:
- [ ] Format constraints (dates, numbers)
- [ ] Length limits
- [ ] Required vs optional
- [ ] Include Korean descriptions as field metadata
Phase 4: MCP Tools (server.py) โ
Based on your usage examples, create tools like:
- [ ] Primary tool for main functionality
- [ ] Search/list tool if applicable
- [ ] Batch processing tool if supported
- [ ] Status/validation tools
Each tool will have:
- [ ] Clear description in Korean and English
- [ ] Parameter validation
- [ ] Input formatting (remove hyphens, convert dates)
- [ ] Helpful error messages
- [ ] Response formatting
Phase 5: Testing โ
- [ ] Unit tests for each API method
- [ ] MCP tool tests with mocked responses
- [ ] Edge case tests (empty data, max items, invalid input)
- [ ] Integration test with real API (if key provided)
Phase 6: Documentation โ
- [ ] README with your exact usage examples
- [ ] Tool descriptions with parameter details
- [ ] Response format documentation
- [ ] Error code reference
Phase 7: Deployment โ
- [ ] Build and deploy using automated script:bash
# Deploy to PyPI (requires PYPI_API_TOKEN in .env) uv run python scripts/deploy_to_pypi.py {api-name} - [ ] Verify deployment:bash
# Check PyPI page curl -I https://pypi.org/project/data-go-mcp.{api-name}/ # Test installation uvx data-go-mcp.{api-name}@latest
Phase 8: Claude Desktop Setup โ
{
"mcpServers": {
"{auto-generated-name}": {
"command": "uvx",
"args": ["data-go-mcp.{api-name}@latest"],
"env": {
"{AUTO_GENERATED_ENV_VAR}": "your-api-key"
}
}
}
}๐ง Troubleshooting โ
Common Issues and Solutions โ
Script Name Error on PyPI โ
Problem: After deploying to PyPI, you see:
warning: An executable named `data-go-mcp.{api-name}` is not provided by package `data-go-mcp-{api-name}`.Solution: The script name in pyproject.toml must be quoted to support dots:
[project.scripts]
# โ Wrong - unquoted
data-go-mcp-fsc-financial-info = "data_go_mcp.fsc_financial_info.server:main"
# โ
Correct - quoted
"data-go-mcp.fsc-financial-info" = "data_go_mcp.fsc_financial_info.server:main"After fixing, increment version and redeploy:
- Update version in
pyproject.toml,__init__.py, andserver.py - Deploy using script (automatically builds and uploads):bash
uv run python scripts/deploy_to_pypi.py {api-name}
๐ Information Extraction Checklist โ
When you paste the API documentation, I'll look for:
- [ ] Service name โ auto-generate all naming
- [ ] Base URL โ configure client
- [ ] Auth method โ implement authentication
- [ ] Endpoints โ create methods
- [ ] Parameters โ build models
- [ ] Constraints โ add validation
- [ ] Examples โ create tests
- [ ] Error codes โ handle exceptions
๐ฏ Success Metrics โ
Your MCP server will be complete when:
- โ All your usage examples work correctly
- โ Tests cover all endpoints (target: 20+ tests)
- โ PyPI package published and installable
- โ Claude Desktop can execute your examples
- โ Error handling works for edge cases
โก Quick Start โ
Automated Template Generation: โ
# Run cookiecutter to create new MCP server
uv run cookiecutter template/ -o src/
# Or use the Python script for interactive mode
uv run python scripts/create_mcp_server.pyWhat to Provide: โ
Just paste:
- Complete API documentation (Korean or English)
- 2-3 real usage examples
- Sample request/response if available
I'll handle everything else automatically!
Ready? Paste your API documentation and examples below: