mcp-go-example
by: masacento
Model Context Protocol server example using Go
📌Overview
Purpose: The framework serves as a simple example server for the Model Context Protocol utilizing SQLite and Go, primarily for educational purposes.
Overview: This example project allows users to understand and implement the Model Context Protocol with a focus on SQLite database operations in Go. It is designed to facilitate learning and does not include advanced features like security or multiuser support.
Key Features:
-
Simple Setup: The project includes basic instructions for integration with Claude desktop, allowing for quick configuration and usage.
-
Testing and Building Support: Built-in commands for testing the application and building it with flags for optimization and reduced size ensure a smooth development workflow.
mcp-go-example
Model Context Protocol sqlite example server using Go.
This project is for learning purposes only. No security implications or multiuser support.
The Python version is available here:
https://github.com/modelcontextprotocol/servers/tree/main/src/sqlite
Python version quickstart guide:
https://modelcontextprotocol.io/quickstart
Usage
Edit Claude Desktop config at ~/Library/Application Support/Claude/claude_desktop_config.json
:
{
"mcpServers": {
"sqlite": {
"command": "path/to/mcp-go-example",
"args": []
}
}
}
Build the project and follow the quickstart guide at https://modelcontextprotocol.io/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 (c) 2024 Masa Cento