Skip to content

codewithfourtix/gopher-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gopher-context logo

gopher-context

A lightweight MCP server in Go that gives Claude eyes into your codebase.
Point it at any project folder. Ask Claude anything. It finds the answers itself.

Go MCP License Status


What is this?

gopher-context is a Model Context Protocol server written in Go.

You run it once, point it at your project folder, and Claude Desktop connects to it. From that point, Claude can navigate your entire codebase — reading files, understanding structure, answering questions — without you pasting a single line of code.

It speaks MCP over SSE (Server-Sent Events), so it works both locally and hosted on a server. If you host it, your whole team shares the same Claude-powered codebase assistant. Everyone just adds one URL to their config.


Tools Exposed

Tool Description
list_files Returns the full directory tree of your project. Claude calls this first to understand what exists.
read_file Reads any file by path. Claude picks the relevant ones based on your question.
get_time Returns the current server time.
add_numbers Adds two numbers. Useful as a hello-world sanity check.

Sequence Diagram

Sequence diagram showing Claude tool call flow

Getting Started

1. Clone the repo

git clone https://github.com/yourusername/gopher-context.git
cd gopher-context

2. Install dependencies

go mod tidy

3. Set your codebase path (optional)

The server uses the CODEBASE_PATH environment variable. If not set, it defaults to the current directory.

To point it at a specific project, set the environment variable before running:

Linux/Mac:

export CODEBASE_PATH=/path/to/your-project
go run main.go

Windows (PowerShell):

$env:CODEBASE_PATH = "C:\path\to\your-project"
go run main.go

Windows (CMD):

set CODEBASE_PATH=C:\path\to\your-project
go run main.go

4. Run the server

go run main.go

You should see:

MCP server running on http://localhost:8080

5. Connect Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "gopher-context": {
      "url": "http://localhost:8080/sse"
    }
  }
}

Restart Claude Desktop. Done.


Sharing with your team

If you want your whole team to share the same server, deploy it to any cloud provider (Railway, Render, a VPS — anything that can run a Go binary). The codebase folder goes with it.

Each teammate just adds your public URL to their config:

{
  "mcpServers": {
    "gopher-context": {
      "url": "https://your-server.com/sse"
    }
  }
---

Project Structure

gopher-context/
├── main.go ← entire server, one file
├── go.mod
├── go.sum
└── assets/
├── logo.png ← project logo
└── sequence-diagram.png ← architecture flow diagram

Built With

  • Go — fast, simple, great for networked services
  • mcp-go — community Go SDK for the Model Context Protocol
  • MCP SSE transport — standard protocol for AI tool connections

License

MIT — do whatever you want with it.


Built while learning MCP from scratch. Simple by design.
```

About

MCP server that connects Claude to your codebase. Point it at any project folder, and Claude can navigate the file structure, read relevant files, and answer questions about your code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages