FeaturesMCP ServersCreating Servers

Creating MCP Servers

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

Creation Methods

MA²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

MA²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
  3. Configure credentials

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

MA²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.

Design Rules Compliance

MA²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. Managing Tools - Add and configure tools
  2. Mock Scenarios - Create realistic test data
  3. Testing - Test your MCP endpoint
  4. Publishing - Share on Anypoint Exchange

Need help? Check Troubleshooting or ask in Discussions.