mcpblogdemo

jtenoriodseldon/mcpblogdemo

3.1

If you are the rightful owner of mcpblogdemo and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Model Context Protocol (MCP) server is a framework designed to facilitate communication between clients and servers using a standardized protocol.

MCP BattleBots Demo

This repo accompanies the blog post:
👉 BattleBots + MCP = Fun: Building Custom Tools in C# That Your IDE and Workflows Understand

It demonstrates how to:

  • Build a C# BattleBots API (.NET 10).
  • Wrap it with an MCP server using the Microsoft MCP SDK.
  • Debug with MCP Inspector.
  • Integrate with Visual Studio Insiders / VS Code Insiders.
  • Automate workflows using n8n + Ollama.

Prerequisites


Projects

1. BattleBots API

A minimal API returning competitor names.

Run the API:

  • Navigate to BattleBots.Api
  • Execute dotnet run

API will start at:
http://localhost:5000/battlebots


2. BattleBots MCP Server

Wraps the API as an MCP tool (list-battlebots).

Run the server:

  • Navigate to BattleBots.Mcp
  • Execute dotnet run

MCP server will start at:
http://localhost:3001/mcp

Environment Variables:

  • BATTLEBOTS_API_BASE → defaults to http://localhost:5000
  • BATTLEBOTS_API_LIST_PATH → defaults to /battlebots

The magic is in the [McpServerTool] attribute, which makes the method discoverable as an MCP tool by clients like VS Code, Inspector, and n8n.


3. MCP Inspector

Run to test/debug your MCP server:

You’ll see the list-battlebots tool and can invoke it directly.


4. VS Code / Visual Studio Insiders

Create a .mcp.json file (in %USERPROFILE% or solution root) with the following content:

{ "servers": { "battlebots": { "type": "http", "url": "http://localhost:3001/ " } } }

Open the MCP tools panel in VS Code Insiders or Visual Studio Insiders, and you’ll find the list-battlebots tool available.


5. n8n Workflow

Import the provided MCP Sample.json into n8n.

Workflow nodes:

  • Trigger → When chat message received
  • Ollamallama3.1:8b reasoning
  • AI Agent → routes requests to MCP tool
  • MCP battlebots tool → fetches competitor names

Examples:

  • Filter bots by letter (s)
    The workflow will only return competitor names starting with s.

  • Order & count
    The workflow can order names alphabetically and count the number of characters in each name.