I have successfully integrated a Model Context Protocol (MCP) server into scmd. This allows AI assistants to directly interact with your personal command knowledge base.
- Created
internal/mcpwhich uses the official Go MCP SDK. - Implemented three core tools:
search_commands: Hybrid search (keyword + vector).add_command: Save new commands to the database.get_stats: Overview of entries and embedding coverage.
- Added the
--mcpflag to the main command line interface. - Updated the help menu to include the new capability.
- Upgraded project to Go 1.25.0 to support the MCP SDK.
- Added
github.com/modelcontextprotocol/go-sdkdependency.
To register it as an MCP server, you first need a compiled binary:
go build -o scmd.exe ./cmd/scmd/Add the following to your mcp_config.json:
{
"mcpServers": {
"scmd": {
"command": "C:/Users/ricardo/Programming/scmd/scmd.exe",
"args": ["--mcp"]
}
}
}Important
The MCP server uses the same ~/.scmd/config.json as your CLI. Ensure your database connection and AI provider settings are correct there.
- Transport: Communicates via standard input/output (stdio), the standard for local MCP servers.
- Safety: The server runs with the same permissions as your current user.
- AI Integration: When using
add_commandvia MCP, it will automatically attempt to generate embeddings if you have an AI provider (Ollama or Gemini) configured.
Tip
You can now ask an AI assistant: "Search my scmd database for docker network commands" or "Save this command to scmd: docker system prune -a" and it will work!