Dart MCP Server Template

by jhgaylor

160 downloads
Not rated
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…

Details

Author
jhgaylor
Downloads
160
Categories
Developer Tools

- 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

Clone the template, rename the package name throughout the codebase, remove the existing .git history, and initialize a new git repository. Then update pubspec.yaml, modify configuration in lib/src/config.dart, implement custom logic in lib/src/server.dart, and run the server via one of the entrypoints: dart bin/stdio_server.dart, dart bin/sse_server.dart, or dart bin/streamable_http_server.dart.

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",
            "."
        ]
    }
}

Dart MCP Server Template

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.