home / mcp / searchfox mcp server
Provides access to Searchfox code search across Mozilla repos and file retrieval via MCP.
Configuration
View docs{
"mcpServers": {
"canova-searchfox-mcp": {
"command": "node",
"args": [
"/path/to/searchfox-mcp/dist/index.js"
]
}
}
}You can use this MCP server to search Mozilla’s codebase with Searchfox and retrieve file contents via MCP. It lets AI assistants query across multiple repositories and fetch exact file content for you, all through a simple local stdio server that you run alongside your MCP client.
To use the Searchfox MCP server, connect your MCP client to the local stdio server you run on your machine. You can perform two main actions: search code patterns across Mozilla repositories and retrieve the contents of a specific file from a repository.
- Search code: Use the search tool to look for exact literal strings or enable a regular expression pass to broaden results. You can filter by repository and by file path patterns to narrow results. If you need broader results, run separate searches or switch to regexp mode.
- Get file: Retrieve the contents of a file from a Mozilla repository using the raw content API. Provide the file path within the repository and choose the repository you want to inspect.
Prerequisites: ensure you have Node.js and npm installed on your machine.
1. Clone the project to your local machine.
2. Install dependencies.
# Install dependencies
npm install3. Build the project.
npm run build4. Configure your MCP client to connect to the local Searchfox MCP server. Create or edit your client configuration to include the stdio-based server entry described in the next step.
The server runs via a local stdio transport. Use the following command to start the server in development environments after you have built the project.
node /path/to/searchfox-mcp/dist/index.jsYour client configuration can point to the local stdio MCP server with the following example.
{
"mcpServers": {
"searchfox": {
"command": "node",
"args": [
"/path/to/searchfox-mcp/dist/index.js"
]
}
}
}Search for code patterns across Mozilla repositories using Searchfox with optional repository, path filter, case sensitivity, and regular expression mode.
Retrieve the contents of a specific file from a Mozilla repository via the GitHub raw content API.