FeaturesMCP ServersCreating Servers

Creating MCP Servers

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

Creating an MCP server from scratch

Creation Methods

A²D offers three approaches to create MCP servers:

  1. From URL - Import from existing MCP server
  2. From OpenAPI - Convert OpenAPI/Swagger spec
  3. 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

  1. Navigate to MCP Servers page
  2. Click “New Server”
  3. Select “From URL”
  4. Enter server details:
    • Name: Descriptive name
    • Description: What the server does
    • URL: MCP endpoint URL (e.g., https://api.example.com/mcp)
  5. Click “Import & Introspect”

What Happens

A²D will:

  1. Connect to the URL
  2. Call initialize to get server info
  3. Call tools/list to discover tools
  4. Call resources/list to discover resources
  5. Call prompts/list to discover prompts
  6. 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/mcp

After 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:

  1. Enable “Requires Authentication”
  2. 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
  3. Configure credentials

OAuth2 Client Credentials

For servers using OAuth2 Client Credentials flow:

  1. Select “OAuth2 Client Credentials” as auth type
  2. 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:data

The 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 curl first
  • 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

  1. Navigate to MCP Servers page
  2. Click “New Server”
  3. Select “From OpenAPI”
  4. Provide spec:
    • Upload File: Upload .json or .yaml
    • Paste JSON: Copy/paste spec
    • URL: Link to hosted spec
  5. Configure conversion:
    • Base URL: API base URL
    • Auth: Configure if needed
  6. Click “Convert & Create”

What Happens

A²D will:

  1. Parse OpenAPI spec
  2. Convert each endpoint to an MCP tool
  3. Map request parameters to tool input schema
  4. Create tool descriptions from spec
  5. Generate server with all tools

Conversion Rules

OpenAPIMCP Tool
Path + MethodTool name (e.g., get_weather)
Summary/DescriptionTool description
ParametersInput schema properties
ResponsesOutput schema (documentation only)
SecurityAuthentication 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 data

Resulting 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:

  1. Review tool names: Edit for clarity
  2. Enhance descriptions: Add AI-friendly details
  3. Add mock scenarios: Create test responses
  4. Configure auth: Set up authentication
  5. 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

  1. Navigate to MCP Servers page
  2. Click “New Server”
  3. Select “From Scratch”
  4. Enter server details:
    • Name: Server name
    • Description: Detailed description (200+ chars recommended)
    • Version: Semantic version (e.g., 1.0.0)
  5. Click “Create Server”
  6. 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.0

Step 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

  1. Copy your MCP endpoint URL
  2. Use curl or 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:

AnnotationMeaning
titleA human-readable name for the tool
readOnlyHintThe tool doesn’t change anything
destructiveHintThe tool may delete or overwrite data (only meaningful when it isn’t read-only)
idempotentHintCalling it again with the same arguments has no extra effect
openWorldHintThe 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:

  1. Ensure compliance score > 80%
  2. Click “Publish to Exchange”
  3. Configure Exchange settings
  4. Click “Publish”

Your server spec will be published to Anypoint Exchange!

Comparison: Which Method?

FeatureFrom URLFrom OpenAPIFrom Scratch
Speed⚡ Fast⚡⚡ Medium⚡⚡⚡ Slow
CustomizationLimitedMediumFull
MocksManualManualBuilt-in
Best forExisting MCPREST APIsNew designs
Learning curveEasyMediumEasy

Next Steps

After creating your server:

  1. MCP Servers - Tools, resources and prompts
  2. Mock Scenarios - Create realistic test data
  3. Testing - Test your MCP endpoint
  4. Publishing - Share on Anypoint Exchange

Your MCP server is ready to mock, test and publish.