MCP ExplorerExplorer

Mcp Go Example

@masacentoon 9 months ago
9 MIT
FreeCommunity
AI Systems
使用Go的模型上下文协议服务器示例

Overview

What is Mcp Go Example

mcp-go-example is an example server implementation of the Model Context Protocol using the Go programming language. It serves as a learning tool and demonstrates how to set up a basic server without security features or multiuser support.

Use cases

Use cases for mcp-go-example include prototyping applications that require a simple server setup, testing the Model Context Protocol, and serving as a reference for developers transitioning from Python implementations.

How to use

To use mcp-go-example, edit the Claude Desktop configuration file located at ‘~/Library/Application Support/Claude/claude_desktop_config.json’ to include the server command and arguments. Build the server using the provided commands and follow the quickstart guide for further instructions.

Key features

Key features of mcp-go-example include its simplicity for educational purposes, the use of SQLite for data storage, and the ability to run tests and build the server with minimal configuration.

Where to use

mcp-go-example can be used in educational settings for learning about server implementation and the Model Context Protocol. It is suitable for developers looking to understand the basics of building a server in Go.

Content

mcp-go-example

Model Context Protocol sqlite example server using Go.
This is just for learning purpose. No security implications, No multiuser support.

Python version is here.
https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite

Python version quickstart is here.
https://modelcontextprotocol.io/quickstart

Usasge

Edit Claude Desktop config at ~/Library/Application\ Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "sqlite": {
      "command": "path/to/mcp-go-example",
       "args": []
    }
  }
}

build and follow quickstart.

Tasks

test

go test

build

Requires: test

CGO_ENABLED=0 go build -ldflags="-s -w" -trimpath .

inspect

Requires: build

npx -y @modelcontextprotocol/inspector ./mcp-go-example 

log

tail -f /tmp/mcp-go-example.log

License

MIT License

Copyright © 2024 Masa Cento

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers