Modular MCP Server
by da-snap
This is a Go implementation of the Model Context Protocol (MCP) server using the `github.com/metoro-io/mcp-golang` library, restructured in a modular way. It provides tools for interacting with a system based on the MCP protocol.
Last updated: N/A
What is Modular MCP Server?
The Modular MCP Server is a Go-based implementation of an MCP server, designed with a modular architecture. It leverages the github.com/metoro-io/mcp-golang
library and provides a set of tools for interacting with the system.
How to use Modular MCP Server?
To use the server, first build it using go build -o mcp-server
in the cmd/mcp-server
directory. Then, run the executable ./mcp-server
. Configuration can be done via command-line flags, environment variables, or programmatically. Security is enforced through path restrictions and command whitelisting.
Key features of Modular MCP Server
Modular design
Path restriction system for security
Command whitelisting for shell execution
Configurable via command-line, environment variables, or programmatically
Extensible tool system
Uses github.com/metoro-io/mcp-golang
Use cases of Modular MCP Server
Remote file access and manipulation
Secure execution of shell commands
Integration with MCP-based systems
Automated system administration tasks
Development and testing of MCP clients
FAQ from Modular MCP Server
How do I configure allowed paths?
How do I configure allowed paths?
You can configure allowed paths using command-line flags, environment variables (MCP_ALLOWED_PATHS), or programmatically through the config package.
How do I add a new tool?
How do I add a new tool?
Create a new file in the internal/tools
directory, implement the Tool
interface, optionally implement the ConfigAware
interface, and register the tool in cmd/mcp-server/main.go
.
What security measures are in place?
What security measures are in place?
The server includes a path restriction system to limit file operations and command whitelisting for shell execution. Common sensitive directories are automatically denied.
What is the default behavior if no paths are specified?
What is the default behavior if no paths are specified?
If no paths are specified, the server defaults to allowing only the current working directory.
How do I run tests?
How do I run tests?
Run tests using the command go test ./...
.