The MCP (Model Context Protocol) server extracts symbol outlines from your codebase using Tree-sitter's query language, providing clean, efficient context for LLM coding agents. It supports multiple programming languages and can be used either as an MCP server or a standalone CLI tool.
Install Go:
brew install go
Install the latest version of glyph:
GOBIN=/usr/local/bin go install "github.com/benmyles/glyph@latest"
Run glyph as an MCP server for integration with LLM coding agents:
glyph mcp
Extract symbols directly from the command line:
glyph cli '/path/to/project/*.go'
With detail level option:
glyph cli -detail=minimal '/path/to/project/**/*.js'
Available options:
-detail
: Level of detail (minimal
, standard
, or full
). Default is standard
.Note: All file patterns must be absolute paths.
Shows just symbol names and types with line numbers:
- func: main (line 15)
- struct: Server (line 5)
- method: Start (line 10)
Shows signatures and declarations:
- func: func main()
- struct: type Server struct
- method: func (s *Server) Start() error
Shows complete symbol definitions with code blocks:
- func (lines 15-20):
func main() { server := &Server{} server.Start() }
Add glyph to Claude Code using the MCP command:
# Add glyph as a local MCP server
claude mcp add glyph /usr/local/bin/glyph mcp
Verify the installation:
# List all configured servers
claude mcp list
# Check glyph server details
claude mcp get glyph
You can check the server status within Claude Code using the /mcp
command.
Add glyph to your Cursor MCP configuration:
{
"mcpServers": {
"glyph": {
"command": "/usr/local/bin/glyph",
"args": ["mcp"]
}
}
}
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "glyph" '{"command":"/usr/local/bin/glyph","args":["mcp"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"glyph": {
"command": "/usr/local/bin/glyph",
"args": [
"mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"glyph": {
"command": "/usr/local/bin/glyph",
"args": [
"mcp"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect