Creating MCP Servers
Learn the three ways to create MCP servers in A²D.

Creation Methods
A²D offers three approaches to create MCP servers:
- From URL - Import from existing MCP server
- From OpenAPI - Convert OpenAPI/Swagger spec
- From Scratch - Build manually with mock data
Method 1: From URL
Import an existing MCP server by providing its endpoint URL.
When to Use
- You have an existing MCP server
- Want to test or modify a live server
- Need to quickly prototype against real endpoints
Steps
- Navigate to MCP Servers page
- Click “New Server”
- Select “From URL”
- Enter server details:
- Name: Descriptive name
- Description: What the server does
- URL: MCP endpoint URL (e.g.,
https://api.example.com/mcp)
- Click “Import & Introspect”
What Happens
A²D will:
- Connect to the URL
- Call
initializeto get server info - Call
tools/listto discover tools - Call
resources/listto discover resources - Call
prompts/listto discover prompts - Create server with all components
Example URL Import
Name: Weather API
Description: Real-time weather data for cities worldwide
URL: https://weather-mcp.example.com/mcpAfter import, you’ll have:
- ✅ Server created
- ✅ All tools imported with schemas
- ✅ All resources imported
- ✅ All prompts imported
- ⚠️ No mock scenarios (add manually)
Adding Authentication
If the target server requires auth:
- Enable “Requires Authentication”
- Select auth type:
- Bearer Token: OAuth/JWT tokens
- Basic Auth: Username/password
- API Key: Custom API key header
- OAuth2 Client Credentials: Automated OAuth2 token management with refresh
- Configure credentials
OAuth2 Client Credentials
For servers using OAuth2 Client Credentials flow:
- Select “OAuth2 Client Credentials” as auth type
- Configure:
- Token URL: OAuth2 token endpoint (must be HTTPS)
- Client ID: Your application’s client ID
- Client Secret: Your application’s client secret (encrypted at rest)
- Audience (optional): Target audience for the token
- Scope (optional): Space-separated list of scopes
Features:
- ✅ Automatic token fetching and refresh
- ✅ Two-level caching (memory + database) for performance
- ✅ Smart retry with exponential backoff on failures
- ✅ Secure credential storage (encrypted client secrets)
Example Configuration:
Token URL: https://auth.example.com/oauth/token
Client ID: your-client-id
Client Secret: your-client-secret
Audience: https://api.example.com
Scope: read:data write:dataThe system will automatically fetch access tokens when needed and cache them until expiry.
Troubleshooting URL Import
“Failed to connect”:
- Check URL is accessible
- Verify it’s a valid MCP endpoint
- Test with
curlfirst - Check for CORS issues
“No tools found”:
- Server may not have tools
- Check server implements
tools/list - Verify server is MCP-compliant
“Timeout”:
- Server may be slow to respond
- Try again with better network
- Check server status
Method 2: From OpenAPI
Convert an OpenAPI (Swagger) specification into an MCP server.
When to Use
- You have an OpenAPI/Swagger spec
- Want to expose REST API as MCP
- Need to create tools from existing API documentation
Steps
- Navigate to MCP Servers page
- Click “New Server”
- Select “From OpenAPI”
- Provide spec:
- Upload File: Upload
.jsonor.yaml - Paste JSON: Copy/paste spec
- URL: Link to hosted spec
- Upload File: Upload
- Configure conversion:
- Base URL: API base URL
- Auth: Configure if needed
- Click “Convert & Create”
What Happens
A²D will:
- Parse OpenAPI spec
- Convert each endpoint to an MCP tool
- Map request parameters to tool input schema
- Create tool descriptions from spec
- Generate server with all tools
Conversion Rules
| OpenAPI | MCP Tool |
|---|---|
| Path + Method | Tool name (e.g., get_weather) |
| Summary/Description | Tool description |
| Parameters | Input schema properties |
| Responses | Output schema (documentation only) |
| Security | Authentication config |
Example OpenAPI Import
OpenAPI Spec:
paths:
/weather:
get:
summary: Get current weather
description: Returns current weather for a city
parameters:
- name: city
in: query
required: true
schema:
type: string
responses:
200:
description: Weather dataResulting MCP Tool:
{
"name": "get_weather",
"description": "Get current weather. Returns current weather for a city",
"inputSchema": {
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "city parameter"
}
},
"required": ["city"]
}
}Customization After Import
After importing from OpenAPI:
- Review tool names: Edit for clarity
- Enhance descriptions: Add AI-friendly details
- Add mock scenarios: Create test responses
- Configure auth: Set up authentication
- Test endpoints: Verify everything works
Supported OpenAPI Versions
- ✅ OpenAPI 3.0.x
- ✅ OpenAPI 3.1.x
- ✅ Swagger 2.0
- ⚠️ Some extensions may not be supported
Method 3: From Scratch (Mock)
Build an MCP server from scratch with mock data - no code required!
When to Use
- Prototyping a new API design
- Creating test servers for development
- Building examples or demos
- Designing MCP servers before implementation
Steps
- Navigate to MCP Servers page
- Click “New Server”
- Select “From Scratch”
- Enter server details:
- Name: Server name
- Description: Detailed description (200+ chars recommended)
- Version: Semantic version (e.g., 1.0.0)
- Click “Create Server”
- Add components:
- Tools: Functions agents can call
- Resources: Data agents can read
- Prompts: Message templates
Building Your First Mock Server
Let’s build a simple weather server:
Step 1: Create Server
Name: Weather API
Description: Provides current weather information for cities worldwide.
Returns temperature, conditions, humidity, and wind speed.
Version: 1.0.0Step 2: Add a Tool
Click “Add Tool” and configure:
Name: get_weather
Description: Get current weather for any city. Returns temperature in
Fahrenheit, weather conditions (sunny, cloudy, rainy),
humidity percentage, and wind speed in mph.Input Schema:
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "City name (e.g., 'San Francisco', 'London')"
}
},
"required": ["city"]
}Step 3: Add Mock Scenarios
Add realistic test data:
Scenario 1: San Francisco
Condition: city equals "San Francisco"
Response:
{
"temperature": 72,
"conditions": "Sunny",
"humidity": 65,
"wind_speed": 10
}Scenario 2: New York
Condition: city equals "New York"
Response:
{
"temperature": 45,
"conditions": "Cloudy",
"humidity": 78,
"wind_speed": 15
}Default Scenario
Condition: (none - default)
Response:
{
"temperature": 70,
"conditions": "Partly Cloudy",
"humidity": 60,
"wind_speed": 8,
"note": "Weather data not available for this city"
}Step 4: Test Your Server
- Copy your MCP endpoint URL
- Use
curlor Postman to test:
curl -X POST YOUR_ENDPOINT_URL \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": {"city": "San Francisco"}
}
}'Expected response:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"content": [{
"type": "text",
"text": "{\"temperature\":72,\"conditions\":\"Sunny\",\"humidity\":65,\"wind_speed\":10}"
}]
}
}Adding Resources
Resources provide static data:
URI: weather://cities
Name: Available Cities
Description: List of all cities with weather data
MIME Type: application/json
Content:
["San Francisco", "New York", "London", "Tokyo", "Paris"]Adding Prompts
Prompts are conversation templates:
Name: weather_query
Description: Template for asking about weather
Arguments:
- location (required): City to query
Template:
What's the weather like in {location}? Include temperature and conditions.Adding Tool Annotations (Optional)
Tool annotations are optional hints that tell MCP clients and gateway policies what a tool does. A new tool has none, and nothing requires them. Without annotations, the tool works exactly as before.
To add them, open the Add Tool or Edit Tool dialog, switch on Annotations (optional), and set any of these:
| Annotation | Meaning |
|---|---|
title | A human-readable name for the tool |
readOnlyHint | The tool doesn’t change anything |
destructiveHint | The tool may delete or overwrite data (only meaningful when it isn’t read-only) |
idempotentHint | Calling it again with the same arguments has no extra effect |
openWorldHint | The tool talks to external systems |
Each hint is Not set, Yes or No. Hints you leave as Not set are not sent. The mock server returns the hints you set on tools/list:
{
"name": "get_weather",
"description": "Get the current weather for a city",
"inputSchema": { "type": "object", "properties": { "city": { "type": "string" } } },
"annotations": { "readOnlyHint": true, "destructiveHint": false }
}Use annotations when a client or policy needs them:
- Clients such as Gemini Enterprise ask for confirmation before every tool call unless the tool is marked
readOnlyHint: true. - Gateway policies applied on top of an MCP server, such as an MCP tool annotation guard, read these hints to allow or block calls.
Annotations are also kept when you import a server from a URL or a spec file, included in the downloaded spec, and available on the A²D Platform MCP tools add_mcp_tool and update_mcp_tool. On update_mcp_tool, only the keys you pass change; a key set to null is removed, and annotations: null removes them all.
Annotations are hints, not security controls. A client may ignore them, so don’t rely on them to protect data.
Adding Icons (Optional)
Tools, resources and prompts can carry an icon, as defined by MCP 2025-11-25. Clients such as the Protocol Tester show it next to the name. Icons are optional; without one, nothing changes.
In the Add or Edit dialog of a tool, resource or prompt, fill in Icon URL (optional). It must be an https:// URL or a data:image/... URI. Clear the field to remove the icon.
The mock server then sends the icon on tools/list, resources/list and prompts/list, and only for items that have one:
{
"name": "get_weather",
"icons": [{ "src": "https://example.com/weather.png" }]
}Icons are kept when you download a spec, upload a spec file, export and import, duplicate or copy a server. The A²D Platform MCP tools add_mcp_tool, update_mcp_tool, add_mcp_resource, update_mcp_resource, add_mcp_prompt and update_mcp_prompt accept an icons array (up to 8 entries, each with src and optional mimeType, sizes and theme); pass null on an update to remove them.
The database migration 20261201100000_mcp_children_icons.sql adds the icons column. Until it has run, servers without icons keep working as before.
Design Rules Compliance
A²D automatically checks your server against 10 design rules:
- ✅ Naming: Clear, descriptive names
- ✅ Descriptions: Detailed (200+ chars)
- ✅ Schemas: Well-defined input schemas
- ✅ Examples: Mock scenarios for testing
- And more…
View compliance score on server details page.
Publishing to Exchange
Once your server is ready:
- Ensure compliance score > 80%
- Click “Publish to Exchange”
- Configure Exchange settings
- Click “Publish”
Your server spec will be published to Anypoint Exchange!
Comparison: Which Method?
| Feature | From URL | From OpenAPI | From Scratch |
|---|---|---|---|
| Speed | ⚡ Fast | ⚡⚡ Medium | ⚡⚡⚡ Slow |
| Customization | Limited | Medium | Full |
| Mocks | Manual | Manual | Built-in |
| Best for | Existing MCP | REST APIs | New designs |
| Learning curve | Easy | Medium | Easy |
Next Steps
After creating your server:
- MCP Servers - Tools, resources and prompts
- Mock Scenarios - Create realistic test data
- Testing - Test your MCP endpoint
- Publishing - Share on Anypoint Exchange
Your MCP server is ready to mock, test and publish.