Custom Node & Server Development
Learn how to build your own MCP server, define custom block schemas, and package connectors for reuse.
Building Your Own MCP Server (Python/TypeScript)
Scaffold a new project
bashCopyEdit# TypeScript npx create-contextmesh-server my-server # Python pip install contextmesh-mcp-server mcp-server init my_serverImplement JSON-RPC handlers
Define
initialize,manifest/load,blocks/executemethodsHonor capabilities:
resources,tools,prompts
Run & test locally
bashCopyEditnpm start # for TS python server.py # for Python
Defining Custom Block Schemas
Blocks are the building blocks of your MCP. Define them via JSON Schema:
jsonCopyEdit{
"title": "FetchOnchainData",
"type": "object",
"properties": {
"endpoint": { "type": "string", "format": "uri" },
"query": { "type": "string" }
},
"required": ["endpoint", "query"]
}id: unique block identifier
inputs: data fields your block consumes
outputs: fields your block produces
config: user-configurable settings
Place schemas in schemas/ and reference them in manifest.json.
Packaging & Publishing Connectors
Version your package in
package.jsonorsetup.py.Publish to registry:
bashCopyEdit# npm npm publish # PyPI python -m twine upload dist/*Share on ContextMesh
In the web app, go to Connectors → Publish New
Provide package name and version
Consumers can then import your connector in their manifests by name and version.
Last updated