A Model Context Protocol (MCP) server for the fretplot (CTAN) LuaTeX package written in Go using the official Go SDK for MCP.
This package allows MCP clients to generate fretplot and fretplot-specific LaTeX code from natural language descriptions of musical scales and chord voicings.
Each tool takes a query string.
| Tool | Purpose |
|---|---|
fp |
.fp syntax, parameters, examples |
fps |
.fps syntax, style customization |
fptex |
\fptotikz, \fptemplate, \fpstemplate, \fpscale, and built-in scale/arpeggio macros |
Each tool has a prompt of the same name as the tool associated with it, and each prompt takes a query string as argument to pass to the corresponding tool.
Note: Lua, LaTeX, or fretplot are not required.
$ git clone https://github.com/8vasu/fretplot-mcp
$ cd fretplot-mcp
$ go build .Usage in Claude Code
- Connect to Claude Code:
$ claude mcp add --transport stdio --scope user fretplot -- /path/to/fretplot-mcp- Start a new claude Claude Code session:
$ claudeThe next steps can proceed in 2 ways:
- In the Claude Code session, type
/fpand select an MCP prompt from the menu using Up/Down arrow keys and then pressing Enter. - Type your query. Here are some examples of how your Claude Code prompt might look when you have finished typing your query:
/mcp__fretplot__fp rotate a diagram by 90 degrees clockwise
/mcp__fretplot__fps make C# a red triangle
/mcp__fretplot__fptex B natural minor scale diagram
- Press Enter and wait for the MCP server and the LLM to do their magic!
- Once you have used a particular MCP tool, the fretplot documentation chunk pertaining to that MCP tool will be stored in the context of that Claude Code session, so unless you are in a new Claude Code session or the context gets compressed, subsequent queries pertaining to that MCP tool should be made simply in natural language without MCP prompt/tool usage in order to save tokens.
- Describe what you want at the Claude Code prompt in natural language. For example,
generate fretplot code to scale a diagarm by a factor of 2orgenerate fps code to render B flat as a green circle. - Press Enter and wait for the LLM to pick an MCP tool. If it does not pick an MCP tool and instead tries to search for fretplot in the filesystem, please deny, type
use the fretplot MCP server, and press Enter. - If the LLM has picked the right MCP tool, confirm its usage. Otherwise, deny and ask it to look for a different MCP tool.