Foxy contexts is a Go library for building context servers that support the Model Context Protocol (MCP). The library covers only the server side of the protocol and is suitable for developers who need to implement an MCP server in Go.
Purpose and design approach The library builds context servers declaratively: developers define tools, resources, and prompts, then register them with app.Builder. app.Builder uses Uber's fx App under the hood, so related components can be injected into its container. This design allows the invocation/read/fetch logic of each tool, resource, or prompt to live alongside its definition, while shared parts such as clients and database connections are reused through dependency injection.
Main capabilities According to the repository description, implemented features include: basic lifecycle and ping; Stdio transport; SSE transport; Streamable HTTP transport (beta); for tool input, the toolinput package helps define tool input schemas and validate incoming input; for resources, support for static resources, dynamic resources provided through Resource Providers, and resource subscriptions; for prompts, support for completion; for testing, the foxytest package for functional testing.
Planned features Progress notifications, dynamic resources provided through Resource Templates, Resource Templates completion, logging through MCP, sampling, Roots, pagination, and list_changed notifications are all marked as planned and not yet implemented.
Usage The repository provides examples, such as the list-current-dir-files tool example in examples/list_current_dir_files_tool/main.go. According to the documentation, after starting the inspector, you can open in the browser http://localhost:6274 and try out the tool. Example code in real applications can usually be split into multiple files. For more information, see the repository documentation and examples.
Applicable scenarios and limitations The library is suitable for projects that want to build an MCP server in Go and use dependency injection to organize tool, resource, and prompt code. Limitations are that it only supports the server side of the protocol; some features are still planned or in beta; specific installation commands, fees, and pricing information are not currently provided in the available materials.