Dart MCP Server Template

by jhgaylor

325 downloads Not rated yet
GitHub

About

A template repository for creating Dart server applications compatible with MCP (Model Control Protocol). It provides a starting point with Docker configuration, multiple transport implementations (stdio, SSE, streamable HTTP, in-memory), and a basic project structure, targeted…

Explore

- Streamable HTTP, SSE, and stdio transport support
- Docker configuration for easy containerization
- Integration with the mcp_dart package
-

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Dart MCP Server Template
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

After creating your project from this template:

1. Update the pubspec.yaml with your project details
2. Modify the configuration in lib/src/config.dart as needed
3. Implement your custom server logic
4. Run the server using one of the provided entrypoints:
- dart bin/stdio_server.dart (Standard I/O)
- dart bin/sse_server.dart (Server-Sent Events)
- dart bin/streamable_http_server.dart (HTTP streaming)

This template includes a Dockerfile for easy containerization:

```bash

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "dart mcp server template": {
            "dart-mcp-server-template": {
                "command": "docker",
                "args": [
                    "build",
                    "-t",
                    "my-mcp-server",
                    "."
                ]
            }
        }
    }
}

McpServers

{
    "dart-mcp-server-template": {
        "command": "docker",
        "args": [
            "build",
            "-t",
            "my-mcp-server",
            "."
        ]
    }
}

A template repository for creating Dart server applications compatible with MCP (Model Control Protocol). This template provides a starting point with Docker configuration, server implementations, and basic project structure.

About This Template

This template includes:
- A streamable HTTP server implementation for MCP
- Docker configuration for easy deployment
- Basic project structure with lib, bin, and test directories
- Integration with the mcp_dart package

Project Structure and Features

Server Implementation

- bin/ - Contains executable Dart files to start the server via different transport methods: - dart bin/stdio_server.dart: Start server with standard I/O transport. - dart bin/sse_server.dart: Start server with Server-Sent Events transport. - dart bin/streamable_http_server.dart: Start server with HTTP streaming transport. - All these executables use the core server implementation defined in lib/src/server.dart.

- lib/src/server.dart - Sets up a basic MCP server. This is where the bulk of your custom code will go.

In-Memory Stream Transport

You can connect a Dart client and server entirely in memory using the IOStreamTransport. Here is an end-to-end example.

Using This Template

Clone this repository and manually update the package name:

```bash
git clone https://github.com/jhgaylor/dart-mcp-server-template.git my_new_mcp_server
cd my_new_mcp_server

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.