Superhero Team Management MCP server

Provides a .NET-based superhero team management API for creating and managing heroes with various superpowers, forming teams, and executing missions with tracking capabilities.
Back to servers
Setup instructions
Provider
Daniel Mackay
Release date
Apr 16, 2025
Language
C#
Stats
4 stars

This project provides a superhero management system with a clean architecture API backend and Model Context Protocol (MCP) server for AI assistant integration. The MCP server allows AI assistants to interact with the superhero management system through standardized tools.

Prerequisites

Before getting started, ensure you have the following installed:

Setting Up the Hero API

To run the Hero API:

  1. Navigate to the AppHost directory:
cd Api/tools/AppHost
  1. Start the application using the .NET CLI:
dotnet run

This command will:

  • Launch a SQL Server container for the database
  • Execute migrations to set up the database schema
  • Start the HeroApi at https://localhost:7255
  1. Access the API documentation by opening https://localhost:7255/scalar/v1 in your browser

Running the MCP Server

To start the Model Context Protocol server:

  1. Navigate to the Mcp directory:
cd Mcp
  1. Launch the MCP server:
dotnet run

The MCP server provides tools for AI assistants to interact with the HeroApi.

Using the MCP Inspector

The MCP Inspector is a useful tool for testing your MCP server directly:

  1. Navigate to the Mcp directory:
cd Mcp
  1. Run the MCP Inspector with:
npx @modelcontextprotocol/inspector dotnet run

This will:

  • Start the MCP server
  • Launch the MCP Inspector interface
  • Show all available tools and allow you to test them interactively

API Capabilities

The HeroApi offers the following endpoints:

  • GET /api/heroes - Retrieve all heroes
  • POST /api/heroes - Create a new hero
  • GET /api/teams - Get all teams
  • GET /api/teams/{id} - Get a specific team
  • POST /api/teams - Create a new team
  • POST /api/teams/{id}/heroes/{heroId} - Add a hero to a team
  • POST /api/teams/{id}/execute-mission - Execute a mission with a team
  • POST /api/teams/{id}/complete-mission - Complete a team's current mission

MCP Tools

The MCP server provides these tools for AI assistants:

  • GetHeroes - Retrieve all heroes from the API
  • CreateHero - Create a new hero
  • GetTeams - Retrieve all teams from the API
  • GetTeam - Get a specific team by ID
  • CreateTeam - Create a new team
  • AddHeroToTeam - Add a hero to a team
  • ExecuteMission - Execute a mission with a team
  • CompleteMission - Complete a team's mission
  • Echo and ReverseEcho - Simple tools for testing the MCP connection

Regenerating the API Client

To regenerate the strongly-typed API client using Microsoft Kiota:

  1. Ensure the HeroApi is running
  2. Navigate to the Mcp directory:
cd Mcp
  1. Run the Kiota generator:
dotnet kiota generate --openapi https://localhost:7255/openapi/v1.json --language csharp --class-name HeroClient --clean-output --additional-data false

This will create a new API client in the output directory based on the latest OpenAPI specification.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "dotnet-mcp-hero" '{"command":"dotnet","args":["run","--project","Mcp"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "dotnet-mcp-hero": {
            "command": "dotnet",
            "args": [
                "run",
                "--project",
                "Mcp"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "dotnet-mcp-hero": {
            "command": "dotnet",
            "args": [
                "run",
                "--project",
                "Mcp"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later