mcp-backstage-example

mcp-backstage-example

3

The project showcases how to implement a Model Context Protocol server that interacts with a Backstage instance. It includes a sample agent framework demonstrating server communication, making it a useful tool for developers using LLMs and Backstage.

Bee Agent & Model Context Protocol with Backstage

This repository demonstrates how to create a Model Context Protocol (MCP) server that provides tools that LLMs can use to communicate with a Backstage instance. A sample Agent, built using the Bee Agent Framework, is included to demonstrate how to interact with the MCP server.

Run the Demo

Configure Backstage

Enable static, token-based, access to Backstage. This allows a client to interact with the HTTP API using the token in an authorization header.

appConfig:
  backend:
    auth:
      externalAccess:
      - type: static
        options:
        token: 'notasecuretoken'
        subject: mcp

Run the MCP Server

Install dependencies and prepare environment variables:

cd server
npm i
cp .env.template .env

Edit the .env file to with valid values, then start the server:


# Load variables
source .env

# Build and run the server
npm run build && npm start 

The MCP server will start listening on http://localhost:8080

Run the Agent

In another terminal, install dependencies and set environment variables:

cd agent
cp .env.template .env
npm i

Run the agent:

npm run build && npm start