A Model Context Protocol (MCP) server for interacting with Open Horizon Exchange APIs. This server provides tools and resources for managing Open Horizon services, nodes, and deployment policies.
The Open Horizon MCP Server is built on the Model Context Protocol (MCP) framework, providing a standardized interface for AI assistants to interact with Open Horizon Exchange APIs. It enables AI assistants to perform various operations related to Open Horizon edge computing platform management.
undefinedService Managementundefined
undefinedNode Managementundefined
undefinedPolicy Managementundefined
Clone the repository:
git clone <repository-url>
cd open-horizon-mcp-server
Install dependencies:
npm install
Create a .env file in the root directory with the following variables:
EXCHANGE_URL=<your-exchange-url>
EXCHANGE_ORG=<your-organization>
EXCHANGE_CREDENTIAL=<your-base64-encoded-credentials>
PORT=3000
Start the server on the default port (3000):
npm start
Start the server on a custom port:
npm run start:port --port=8080
Run in development mode with auto-reload:
npm run dev
Build Docker images for different architectures:
# For ARM64
npm run build:docker:arm64
# For AMD64
npm run build:docker:amd64
The project includes scripts for deploying to IBM Cloud Code Engine:
# Deploy to development environment
npm run deploy:dev
# Deploy to staging environment
npm run deploy:stage
# Deploy to production environment
npm run deploy:prod
POST /mcp: Main endpoint for MCP protocol communicationGET /health: Health check endpoint for monitoringThe server provides the following tools through the MCP protocol. Each tool has specific trigger phrases that AI assistants like Claude can use to recognize when to call them.
| Tool Name | Description | Example Trigger Phrases |
|---|---|---|
list-nodes |
List all nodes registered in the Exchange/Management Hub | “List all nodes in the Exchange”, “Show me all registered nodes”, “Get a list of all nodes in the Management Hub”, “What nodes are registered in the system?” |
get-node-policy |
Get the policy associated with a specific node | “Show me the policy for node X”, “What policy is applied to node X?”, “Get node X policy from the Management Hub” |
register-node-policy |
Register a node with a policy | “Register node X with policy Y”, “Apply policy Y to node X”, “Add node X to the Management Hub with policy Y” |
unregister-node |
Unregister a node from the Exchange/Management Hub | “Unregister node X”, “Remove node X from the Exchange”, “Delete node X from the Management Hub” |
| Tool Name | Description | Example Trigger Phrases |
|---|---|---|
list-services |
List all services in the Open Horizon Exchange/Management Hub | “List all services”, “Show available services”, “What services are in the Exchange?”, “Show services in the Management Hub” |
get-service-details |
Get detailed information about a specific service | “Show details for service X”, “Tell me about service X”, “Get information about service X from the Management Hub” |
publish-service |
Publish a new service to the Exchange/Management Hub | “Publish a new service”, “Add service X to the Exchange”, “Register service X with the Management Hub” |
delete-service |
Delete a service from the Exchange/Management Hub | “Delete service X”, “Remove service X from the Exchange”, “Remove service X from the Management Hub” |
generate-service-definition |
Generate a service definition file | “Generate a service definition”, “Create service definition for X”, “Make a service definition template” |
| Tool Name | Description | Example Trigger Phrases |
|---|---|---|
list-deployment-policies |
List all deployment policies in the Exchange/Management Hub | “List all policies”, “Show deployment policies”, “What policies are available?”, “Show policies in the Management Hub” |
get-policy-details |
Get detailed information about a specific policy | “Show details for policy X”, “Tell me about policy X”, “Get policy X information from the Management Hub” |
check-policy-deployments |
Check which workloads are deployed with a specific policy | “What workloads use policy X?”, “Show deployments for policy X”, “Which services are deployed with policy X?” |
check-policy-compatibility |
Check which services are compatible with a specific policy | “Which services are compatible with policy X?”, “Show services compatible with policy X”, “What can run with policy X?” |
delete-policy |
Delete a policy from the Exchange/Management Hub | “Delete policy X”, “Remove policy X from the Exchange”, “Delete policy X from the Management Hub” |
This MCP server is designed to work with AI assistants like Claude that support the Model Context Protocol. Here are some tips to ensure the AI assistant properly recognizes and uses the available tools:
undefinedUse Clear and Specific Requestsundefined
undefinedInclude Key Termsundefined
undefinedBe Explicit About Actionsundefined
undefinedTroubleshootingundefined
User: "List all nodes registered in the Open Horizon Exchange"
AI: [Uses list-nodes tool to retrieve and display all registered nodes]
User: "Show me details about the deployment policy named 'my-policy'"
AI: [Uses get-policy-details tool to retrieve and display policy information]
User: "I want to publish a new service to the Exchange"
AI: [Uses publish-service tool and guides you through the process]
The list-nodes tool is particularly useful for viewing all edge devices registered with your Open Horizon instance. To ensure Claude recognizes when to use this tool:
If Claude doesn’t recognize your request, try rephrasing with one of these specific patterns.
The server includes templates for common operations:
service-definition.json: Basic service definition templateservice-definition-with-inputs.json: Service definition template with user inputsnode.policy.json: Node policy templateconfig.json: Configuration templateconfig-with-inputs.json: Configuration template with user inputsopen-horizon-mcp-server/
├── src/
│ ├── models/
│ │ └── model.ts
│ ├── services/
│ │ └── common.ts
│ ├── tools/
│ │ ├── check-policy-compatibility.ts
│ │ ├── check-policy-deployments.ts
│ │ ├── delete-policy.ts
│ │ ├── delete-service.ts
│ │ ├── generate-service-definition.ts
│ │ ├── get-node-policy.ts
│ │ ├── get-policy-details.ts
│ │ ├── get-service-details.ts
│ │ ├── list-deployment-policies.ts
│ │ ├── list-nodes.ts
│ │ ├── list-services.ts
│ │ ├── publish-service.ts
│ │ ├── register-node-policy.ts
│ │ └── unregister-node.ts
│ ├── mcp-server.ts
│ └── server.ts
├── templates/
│ ├── config-with-inputs.json
│ ├── config.json
│ ├── node.policy.json
│ ├── service-definition-with-inputs.json
│ └── service-definition.json
├── package.json
└── tsconfig.json
npm run build
ISC
Contributions are welcome! Please feel free to submit a Pull Request.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.