This schema declares a single tool that calls the CoinGecko ping endpoint. No API key required.
3
Validate and Call
Create a file called test.mjs:
import { FlowMCP } from 'flowmcp-core'import { main } from './coingecko-ping.mjs'// Validate the schemaconst { status, messages } = FlowMCP.validateSchema( { schema: main } )console.log( status ? 'Schema valid!' : messages )// Call the APIconst result = await FlowMCP.fetch( { schema: main, routeName: 'ping', userParams: {}, serverParams: {}} )console.log( result.dataAsString )// → {"gecko_says":"(V3) To the Moon!"}
Run it:
node test.mjs
You should see Schema valid! followed by the CoinGecko ping response.
4
Run as MCP Server
Create a file called server.mjs to expose your schema as an MCP tool:
import { FlowMCP } from 'flowmcp-core'import { Server } from '@modelcontextprotocol/sdk/server/index.js'import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'import { main } from './coingecko-ping.mjs'const server = new Server( { name: 'my-first-server', version: '1.0.0' }, { capabilities: { tools: {} } })FlowMCP.activateServerTools( { server, schemas: [main] } )const transport = new StdioServerTransport()await server.connect( transport )
Install the MCP SDK:
npm install @modelcontextprotocol/sdk
Run the server:
node server.mjs
Your MCP server is now running over stdio. AI clients like Claude Desktop can connect to it and call the coingecko__ping tool.
The tool name is auto-generated from namespace + tool name: coingecko__ping. AI clients see this name along with the tool description to decide when to call it.
You declared an API endpoint as a schema (no server code needed)
FlowMCP validated the schema structure
FlowMCP called the API with correct URL construction and headers
FlowMCP exposed the schema as an MCP tool with auto-generated Zod validation
The same pattern works for any REST API — add authentication via requiredServerParams and headers, add parameters via the parameters array, add response transformation via the handlers export.