This server implements the Model Context Protocol (MCP) for Backstage, allowing you to interact with Backstage templates directly from the command line or through AI agents like Goose. The integration uses Quarkus Backstage to provide a streamlined interface for template management.
Before installing, ensure you have:
Your Backstage installation must have Service-to-Service authentication enabled. Add the following to your Backstage configuration:
app:
# ...
backend:
# ...
auth:
# ...
externalAccess:
- type: static
options:
token: <put your token here>
subject: curl-requests
Clone the repository:
git clone https://github.com/your-repo/backstage-mcp.git
cd backstage-mcp
Build the application:
./mvnw package
The server will be built as a runnable JAR file at target/quarkus-app/quarkus-run.jar
The MCP server works well with Goose, an AI agent that runs as an interactive shell.
Add the following extension to your Goose config.yaml
file:
quarkus-backstage-mcp:
args:
- --quiet
- /path/to/backstage-mcp/target/quarkus-app/quarkus-run.jar
cmd: jbang
enabled: true
envs: {}
name: quarkus-backstage-mcp
type: stdio
Make sure to replace /path/to/backstage-mcp
with the actual path to your installation.
To view all templates available in your Backstage instance, use the following prompt in Goose:
list all the available backstage templates
Creating a new project involves two steps:
First, extract the default values for a template:
quarkus backstage template info --show-default-values <template name>
Save the output to a values.yaml
file and modify as needed
Then, use Goose to instantiate the template:
create a new project from template <template name> using values from values.yaml
The MCP server will communicate with Backstage to create your project based on the template and parameter values you provided.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.