Skip to main content

Transform Schemas into MCP Servers

FlowMCP transforms your schemas into production-ready MCP servers that AI applications can use immediately.
Prerequisites: Complete the Schema Creation tutorial first.

Basic MCP Server Setup

Create an MCP server that transforms your schemas into AI-accessible tools:
import { FlowMCP } from './src/index.mjs'
import { Server } from '@modelcontextprotocol/sdk/server/index.js'

// Your schemas become AI tools
const schemas = [
  githubSchema       // User profiles, repositories
]

// Create MCP server instance
const server = new Server({
    name: 'my-flowmcp-server',
    version: '1.0.0'
}, {
    capabilities: { tools: {} }
})

// Server parameters for API authentication
const serverParams = {
    GITHUB_TOKEN: process.env.GITHUB_TOKEN
}

// Transform schemas into MCP tools
const { mcpTools } = FlowMCP.activateServerTools({
    server,
    schema: githubSchema,
    serverParams,
    validate: true,
    silent: false
})

console.log('Activated tools:', Object.keys(mcpTools))
// Output: ['github__getUser']

Multiple Schema Activation

// Activate all schemas at once
schemas.forEach(schema => {
    FlowMCP.activateServerTools({
        server,
        schema,
        serverParams,
        validate: true
    })
})

// Result: AI tools from your schemas

Claude Desktop Integration

Step 1: Create Your Server Script (flowmcp-server.js)
import { FlowMCP } from './src/index.mjs'
import { Server } from '@modelcontextprotocol/sdk/server/index.js'

const server = new Server({
    name: 'claude-flowmcp-server',
    version: '1.0.0'
}, {
    capabilities: { tools: {} }
})

const serverParams = {
    GITHUB_TOKEN: process.env.GITHUB_TOKEN
}

// Activate your schemas
const { mcpTools } = FlowMCP.activateServerTools({
    server,
    schema: githubSchema,
    serverParams
})

console.log('✅ FlowMCP server ready for Claude Desktop')
console.log(`📡 Active tools: ${Object.keys(mcpTools).length}`)
Step 2: Configure Claude Desktop Create/edit claude_desktop_config.json:
{
  "mcpServers": {
    "flowmcp": {
      "command": "node",
      "args": ["/absolute/path/to/flowmcp-server.js"],
      "env": {
        "GITHUB_TOKEN": "your-github-token"
      }
    }
  }
}
Step 3: Test Integration
  1. Restart Claude Desktop
  2. Ask: “What tools do you have access to?”
  3. Test with: “Get the GitHub profile for octocat”

Production Configuration

// Production-ready server with security
const server = new Server({
    name: 'production-flowmcp',
    version: '1.0.0'
}, {
    capabilities: { tools: {} }
})

// Enhanced server parameters
const serverParams = {
    GITHUB_TOKEN: process.env.GITHUB_TOKEN
}

// Schema activation
FlowMCP.activateServerTools({
    server,
    schema: githubSchema,
    serverParams,
    validate: true
})

console.log('📊 Production server ready')

Advanced Configuration

Schema Filtering

Filter which schemas to activate based on environment or user needs:
// Filter schemas by namespace
const { filteredArrayOfSchemas } = FlowMCP.filterArrayOfSchemas({
    arrayOfSchemas: allSchemas,
    includeNamespaces: ['github'],
    excludeNamespaces: [],
    activateTags: ['production']
})

// Activate only filtered schemas
filteredArrayOfSchemas.forEach(schema => {
    FlowMCP.activateServerTools({
        server,
        schema,
        serverParams
    })
})

Environment-Specific Deployment

const environment = process.env.NODE_ENV || 'development'

const config = {
    development: {
        validate: true,
        silent: false,
        includeNamespaces: ['github']
    },
    production: {
        validate: true,
        silent: true,
        includeNamespaces: ['github']
    }
}

const { includeNamespaces } = config[environment]
const { filteredArrayOfSchemas } = FlowMCP.filterArrayOfSchemas({
    arrayOfSchemas: allSchemas,
    includeNamespaces
})

console.log(`📦 ${environment} deployment with ${filteredArrayOfSchemas.length} schemas`)

Testing Your Server

Schema Validation Test

async function testServerSetup() {
    console.log('🧪 Testing FlowMCP server setup...')
    
    // Test schema validation
    const validation = FlowMCP.validateSchema({ schema: githubSchema })
    if (!validation.status) {
        console.error('❌ Schema validation failed:', validation.messages)
        return false
    }
    
    console.log('✅ Schema validation passed')
    
    // Test API connectivity
    const result = await FlowMCP.fetch({
        schema: githubSchema,
        userParams: { username: 'octocat' },
        serverParams: { GITHUB_TOKEN: process.env.GITHUB_TOKEN },
        routeName: 'getUser'
    })
    
    if (result.status) {
        console.log('✅ API connectivity working')
        console.log('🎉 Server setup complete!')
        return true
    } else {
        console.error('❌ API test failed:', result.messages)
        return false
    }
}

testServerSetup()

Performance Testing

async function testPerformance() {
    console.log('⚡ Running performance tests...')
    
    const startTime = Date.now()
    const testRequests = 5
    
    const promises = Array.from({ length: testRequests }, () =>
        FlowMCP.fetch({
            schema: githubSchema,
            userParams: { username: 'octocat' },
            serverParams: { GITHUB_TOKEN: process.env.GITHUB_TOKEN },
            routeName: 'getUser'
        })
    )
    
    await Promise.all(promises)
    const averageTime = (Date.now() - startTime) / testRequests
    
    console.log(`📊 Average response time: ${averageTime.toFixed(2)}ms`)
    
    if (averageTime > 5000) {
        console.warn('⚠️  Consider optimization for response times >5s')
    }
}

Deployment Strategies

Local Development

# Simple development server
node server.mjs

# Development with environment variables
GITHUB_TOKEN=your-token NODE_ENV=development node server.mjs

Production Deployment

# Production deployment
node server.mjs

Docker Configuration

Troubleshooting

Common Issues

Server Won’t Start
  • Validate schemas: node -e "console.log(FlowMCP.validateSchema({schema}))"
  • Verify dependencies: npm list
Claude Desktop Integration
  • Use absolute paths in configuration
  • Restart Claude Desktop after config changes
  • Check environment variables are set correctly
API Connectivity
  • Test external APIs directly: curl https://api.github.com/users/octocat
  • Verify API keys are valid and not expired
  • Check network connectivity and firewall settings

Health Monitoring

Next Steps

Expand Your Server: Add more schemas from the Schema Library to increase your server’s capabilities. Production Optimization: Implement caching, rate limiting, and monitoring for production deployments. Advanced Integration: Explore the Architecture Guide for sophisticated deployment patterns.
Success! You now have a working MCP server that transforms your schemas into AI-accessible tools. Your server can handle everything from simple API calls to complex multi-source data integration.