
backstage mcp
提供一个支持 MCP 协议的 Backstage Catalog API 封装,用于与 MCP 客户端交互。
Repository Info
About This Server
提供一个支持 MCP 协议的 Backstage Catalog API 封装,用于与 MCP 客户端交互。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Backstage Catalog Server
This implementation provides a Model Context Protocol (MCP) server that wraps the Backstage Catalog API, allowing MCP clients to interact with Backstage entities.
Features
- Exposes Backstage catalog entities via MCP-compatible endpoints
- Transforms Backstage entity structure to MCP format
- Supports filtering by entity kind, namespace, and labels
- Provides individual entity lookup by reference
- Create new entities in the Backstage catalog
Setup
-
Install dependencies:
pip install -r requirements.txt -
Configure environment variables:
export BACKSTAGE_API_URL=https://your-backstage-instance.com export BACKSTAGE_API_KEY=your-api-key # If required export PORT=8080 # Optional, defaults to 8080 -
Run the server:
python mcp_backstage_server.py
Usage
The server exposes the following endpoints:
-
GET /entities- List all entities, with optional filtering- Query parameters:
kind: Filter by entity kind (e.g., Component, API, System)namespace: Filter by namespacelabel_selector: Filter by labels (e.g., "tier=backend,team=infra")
- Query parameters:
-
GET /entities/{namespace}/{kind}/{name}- Get a specific entity by reference -
POST /entities- Create a new entity in the Backstage catalog- Request body: MCP-formatted entity
- Returns: Created entity in MCP format
Entity Format
The MCP server expects entities in the following format when creating:
{
"apiVersion": "mcp/v1",
"kind": "Component",
"metadata": {
"name": "example-service",
"namespace": "default",
"labels": {
"tier": "backend"
},
"annotations": {
"backstage.io/managed-by": "mcp"
}
},
"spec": {
"type": "service",
"lifecycle": "production",
"owner": "team-a"
}
}
Integration with MCP Clients
MCP clients can connect to this server using the standard MCP client libraries:
from mcp.client import MCPClient
# Read entities
client = MCPClient("http://localhost:8080")
entities = client.get_entities(kind="Component")
# Create entity
new_entity = {
"apiVersion": "mcp/v1",
"kind": "Component",
"metadata": {
"name": "new-service",
"namespace": "default"
},
"spec": {
"type": "service",
"lifecycle": "development",
"owner": "team-b"
}
}
created_entity = client.create_entity(new_entity)
Customization
To extend this implementation or modify the entity transformation logic, you can subclass BackstageMCPServer and override the _transform_backstage_entity or _transform_to_backstage_format methods.
Quick Start
Clone the repository
git clone https://github.com/p7ayfu77/backstage-mcpInstall dependencies
cd backstage-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.