Learn more about how to use this here
This is an example implementation of a Model Context Protocol (MCP) server in Go for use with Cursor.
- Implements a simple "hello" tool that responds with a greeting
- Provides a "bitcoin_price" tool that fetches real-time Bitcoin prices in various currencies
- Includes a test prompt
- Provides a test resource
- Go 1.24 or later
- Cursor IDE
- Internet connection (for the Bitcoin price API)
go build -o mcp-example
- Build the server using the command above
- Open Cursor settings
- Navigate to the "MCP Tools" section
- Click "Add Tool"
- Select "From Directory"
- Browse to this directory and select it
- Click "Install"
Once installed, you can use the MCP tools in Cursor by:
- Opening a chat in Cursor
- The "hello" tool can be triggered with prompts like "Can you greet me with a personalized message?"
- The "bitcoin_price" tool can be triggered with prompts like "What's the current Bitcoin price in USD?" or "Show me the Bitcoin price in EUR"
If you want to modify this example:
- Edit the
main.go
file to add or modify tools, prompts, or resources - Rebuild the server using
go build -o mcp-example
- Restart Cursor to load the changes
main.go
- The main server implementationcursor-mcp-config.json
- Configuration file for Cursorgo.mod
andgo.sum
- Go module files
The Bitcoin price tool uses the free CoinGecko API to fetch real-time cryptocurrency prices. No API key is required for basic usage, but there are rate limits.
MIT