MCP cover image
Andrewdonelson_go-MCP服务器服务 logo
Public

Andrewdonelson_go-MCP服务器服务

See in Github
2024-11-30

镜像://github.com/andrewdonelson/go-mcp-server-service

0

Github Watches

1

Github Forks

0

Github Stars

go-mcp-server-service

A JSON-RPC 2.0 compliant server implementing the Model Context Protocol (MCP) for note management (as an example)

This is an example. You can modify this and use as a Boilerplate for your own project. It supports cross-platform development and includes a command-line interface and service component for both development and release builds.

Features

  • JSON-RPC 2.0 compliant API
  • Cross-platform support (Windows, Linux, macOS)
  • Thread-safe note management
  • Development and release build configurations
  • Service and command-line interface components

Components

Command Line Interface (cmd)

The command-line interface provides direct access to the notes server functionality.

Service (service)

The service component enables system-level integration and background operation.

Resources

The server implements a note storage system with:

  • Custom note:// URI scheme for accessing individual notes
  • Resource metadata including name, description, and MIME type
  • Thread-safe concurrent access

Prompts

Available prompts:

  • summarize-notes: Creates summaries of all stored notes
    • Optional style argument ("brief"/"detailed")
    • Combines all current notes with style preference
    • Thread-safe note access

Tools

Available tools:

  • add-note: Adds a new note to the server
    • Required arguments: name (string), content (string)
    • Thread-safe state updates
    • Returns confirmation message

Building

Prerequisites

  • Go 1.21 or later
  • GNU Make or compatible build tool
  • Git (for version information)

Build Commands

Development builds (includes debug symbols and race detection):

# Build all components for all platforms
make dev

# Build for specific platform
make dev-windows
make dev-linux
make dev-darwin

# Build specific components
make build-cmd
make build-service

Release builds (optimized and stripped):

# Build all components for all platforms
make release-all

# Build for specific platform
make release-windows
make release-linux
make release-darwin

Run locally:

# Run command-line interface
make run-cmd

# Run service
make run-service

View all available targets:

make help

Build Output

Binaries are created in the bin directory:

  • Development builds: bin/dev/<platform>/
  • Release builds: bin/release/<platform>/

Configuration

Claude Desktop Integration

Configure the notes server in Claude Desktop's configuration file:

Location

  • MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%/Claude/claude_desktop_config.json

Development Configuration

{
  "mcpServers": {
    "notes-server": {
      "command": "./bin/dev/<platform>/notes-server",
      "args": []
    }
  }
}

Release Configuration (Service Example)

{
  "mcpServers": {
    "notes-server": {
      "command": "./bin/release/<platform>/notes-service",
      "args": []
    }
  }
}

Development

Project Structure

.
├── cmd/                    # Command-line interface
├── service/               # Service implementation
├── internal/
│   └── server/           # Core server implementation
│       ├── operations.go # Server operations
│       ├── server.go    # Main server logic
│       └── types.go     # Type definitions
├── Makefile              # Build configuration
└── README.md

Debugging

Since the server runs over stdio, we recommend using the MCP Inspector for debugging:

npx @modelcontextprotocol/inspector ./bin/dev/<platform>/notes-server

The Inspector will provide a URL for the debugging interface.

Error Codes

The server implements standard JSON-RPC 2.0 error codes plus custom codes:

Code Description Standard
-32700 Parse error Yes
-32600 Invalid request Yes
-32601 Method not found Yes
-32602 Invalid params Yes
-32603 Internal error Yes
-32001 Resource not found No
-32002 Unsupported operation No

License

MIT License

Copyright (c) 2024 Andrew Lee Donelson

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Andris Teikmanis
  • Latvian GPT assistant for developing GPT applications

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • https://jgadvisorycpa.com
  • This GPT assists in finding a top-rated business CPA - local or virtual. We account for their qualifications, experience, testimonials and reviews. Business operators provide a short description of your business, services wanted, and city or state.

  • Jan Meindl
  • Builds new GPTs

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • modelcontextprotocol
  • 模型上下文协议服务器

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • n8n-io
  • 具有本机AI功能的公平代码工作流程自动化平台。将视觉构建与自定义代码,自宿主或云相结合,400+集成。

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

    Reviews

    1 (1)
    Avatar
    user_qM3l5tMj
    2025-04-15

    The Miden MCP Server by greenhat has significantly improved my server management experience. The seamless integration and robust performance make it an indispensable tool for anyone in need of efficient server solutions. I highly recommend checking it out: https://mcp.so/server/miden-mcp/greenhat