Skip to main content

🚀 Get started in three steps

Transform any REST API into an MCP-compatible interface using FlowMCP schemas.
1

Install FlowMCP Core

Install the core framework to create MCP schemas from API definitions.Prerequisites:
  • Node.js 18+ (required for ES modules)
  • npm, yarn, or pnpm
  • Basic understanding of REST APIs
# Install FlowMCP Core
npm install flowmcp-core
What you get:
  • Schema validation and execution
  • Built-in parameter substitution and response processing
  • Complete filtering system for schema collections
  • Test generation and validation framework
MCP Integration: FlowMCP transforms REST APIs into MCP-compatible tools through schema definitions.
2

Define your API schema

Create a schema that describes your REST API structure and parameters.Create schema.mjs:
import { FlowMCP } from './src/index.mjs'

// Define API schema following FlowMCP specification
export const githubSchema = {
  namespace: 'github',
  flowMCP: '1.2.2',
  root: 'https://api.github.com',
  requiredServerParams: ['GITHUB_TOKEN'],
  headers: {
    'Authorization': 'token {{GITHUB_TOKEN}}',
    'Accept': 'application/vnd.github.v3+json'
  },
  routes: {
    getUser: {
      requestMethod: 'GET',
      description: 'Get GitHub user information',
      route: '/users/{{USER_PARAM}}',
      parameters: [
        { position: { key: "username", value: "{{USER_PARAM}}", location: "insert" }, z: { primitive: "string()", options: ["min(1)", "max(39)"] } }
      ],
      tests: [],
      modifiers: []
    }
  }
}
Key Concepts:
  • Schema structure: Defines namespace, root URL, routes, and parameters
  • Parameter substitution: Use {{USER_PARAM}} for user inputs
  • Validation: Each parameter needs a z validation rule
  • No API keys needed: This example works without authentication
Parameter Format: Parameters use the exact format from FlowMCP Core documentation with simple z: 'string()' validation.
3

Execute API calls

Use FlowMCP to validate schemas and execute API requests with automatic parameter handling.Create test.mjs:
import { FlowMCP } from './src/index.mjs'
import { githubSchema } from './schema.mjs'

async function testAPI() {
  // Validate schema structure
  const validation = FlowMCP.validateSchema({ schema: githubSchema })
  if (!validation.status) {
    console.error('Schema validation failed:', validation.messages)
    return
  }
  
  console.log('✅ Schema validation passed')
  
  // Execute API request
  const userParams = { username: 'octocat' }
  const serverParams = { GITHUB_TOKEN: process.env.GITHUB_TOKEN }
  const result = await FlowMCP.fetch({ 
    schema: githubSchema, 
    userParams, 
    serverParams, 
    routeName: 'getUser' 
  })
  
  if (result.status) {
    console.log('GitHub user:', result.dataAsString)
  } else {
    console.error('API request failed:', result.messages)
  }
  
  // Generate test cases
  const tests = FlowMCP.getAllTests({ schema: githubSchema })
  console.log('Available tests:', tests.length)
}

testAPI()
Run your test:
node test.mjs
Expected Output:
✅ Schema validation passed
GitHub user: {"login":"octocat","id":1,...}
Available tests: 0
What just happened:
  • Schema validation ensured your API definition is correct
  • FlowMCP handled parameter substitution automatically
  • The API request was executed with proper error handling
  • Test cases were automatically extracted from your schema
Success! You’ve successfully used FlowMCP to create a validated, executable API interface.

🎯 What you just accomplished

You’ve successfully created a working FlowMCP integration that demonstrates the core value: transforming REST APIs into validated, executable schemas. Instead of manual API integration:
  • Write custom HTTP requests with manual parameter handling
  • Implement your own validation and error handling
  • Maintain separate code for each API endpoint
You now have schema-driven integration:
  • Declarative API definitions with automatic validation
  • Built-in parameter substitution and error handling
  • Reusable schemas that can be shared and tested
Specific achievements:
  • Schema Validation: Your API structure is validated against FlowMCP specifications
  • Automatic Parameter Handling: User parameters are safely substituted into API requests
  • Error Handling: Built-in error collection and reporting
  • Test Generation: Automatic test case extraction from schema definitions

🔥 Explore advanced features

Build on your foundation with FlowMCP’s advanced capabilities.

Schema Filtering

Work with multiple schemas using FlowMCP’s filtering system:
import { FlowMCP } from './src/index.mjs'

const schemas = [githubSchema]

// Filter by namespace
const { filteredArrayOfSchemas } = FlowMCP.filterArrayOfSchemas({
  arrayOfSchemas: schemas,
  includeNamespaces: ['github'],
  excludeNamespaces: [],
  activateTags: []
})

console.log('Filtered schemas:', filteredArrayOfSchemas.length)

MCP Server Integration

For AI applications, integrate with MCP servers:
import { FlowMCP } from './src/index.mjs'
import { Server } from '@modelcontextprotocol/sdk/server/index.js'

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

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

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

console.log('Activated tools:', Object.keys(mcpTools))

📚 Next steps

For Schema Creation

For MCP Integration

For Production Use

📚 Essential resources

Core Repository: FlowMCP Core - Source code and implementation details Schema Library: Schema Browser - Interactive catalog of extensive API schemas Community Support: GitHub Discussions - Q&A and community help
Need Help? Check the troubleshooting guide for common issues, or ask questions in the GitHub Discussions community.