jasonhawkharris
MCP Serverjasonhawkharrispublic

code search mcp

An MCP server for code search

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
JavaScript
Language
-
License

About This Server

An MCP server for code search

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

Sourcegraph Code Search MCP Server

This is an MCP (Model Context Protocol) server implementation for Sourcegraph's code search capabilities. It allows language models to perform code search queries against Sourcegraph instances.

Features

  • Search code across any Sourcegraph instance (public or private)
  • Support for literal, regexp, and structural search patterns
  • Configurable search limits and parameters
  • Authentication support for private Sourcegraph instances

Installation

# Clone the repository
git clone https://github.com/yourusername/code-search-mcp.git
cd code-search-mcp

# Install dependencies
npm install

# Build the project
npm run build

Usage

Running the Server

# Start the server
npm start

Or directly use the node executable:

node build/index.js

Using as MCP Tool

This MCP server exposes a search_code tool with the following parameters:

  • query (string, required): The search query to execute
  • sourcegraphUrl (string, optional): The Sourcegraph instance URL (defaults to https://sourcegraph.com)
  • token (string, optional): Authentication token for private Sourcegraph instances
  • limit (number, optional): Max number of results to return (defaults to 10)
  • patternType (string, optional): Search pattern type (literal, regexp, or structural, defaults to literal)

Example Usage with Claude.ai

In Claude, you can use this MCP server by first adding it to your configuration:

# Add the MCP server (stdio transport)
claude mcp add sourcegraph-search -- path/to/code-search-mcp

# Or if you've installed it globally with npm
claude mcp add sourcegraph-search -- code-search-mcp

Then you can use Claude Code as normal and it will have access to the Sourcegraph search functionality:

claude code

Then you can ask Claude to use the code search tool:

Search for "context.WithTimeout" in the Go standard library

Development

# Run the development server (builds and starts)
npm run dev

License

ISC

Quick Start

1

Clone the repository

git clone https://github.com/jasonhawkharris/code-search-mcp
2

Install dependencies

cd code-search-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerjasonhawkharris
Repocode-search-mcp
LanguageJavaScript
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation