Second Brain MCP
A semantic search MCP server for codebases that uses OpenAI embeddings to understand natural language queries and find relevant code.
README
🧠 Second Brain MCP
Your code, but searchable like memories. Stop grepping, start remembering. A semantic search MCP server for your codebase—ask natural questions, get smart answers.
TL;DR
Second Brain MCP is a local server that indexes your code and other text-based files, allowing you to perform semantic searches using natural language. It runs as a Model Context Protocol (MCP) server, so you can interact with it from any MCP-compatible client. It uses OpenAI's embedding models to understand the meaning of your code, not just keywords.
🛠️ Tech Stack
This project is a TypeScript-based Node.js application.
| Component | Technology | Key Libraries/Frameworks |
|---|---|---|
| Application Runtime | Node.js | TypeScript, @modelcontextprotocol/sdk |
| Database | SQLite | better-sqlite3 |
| Embeddings | OpenAI | openai |
| Development | Package Manager | npm |
🚀 Quick Start
The following instructions are optimized for a Linux environment (Ubuntu/Debian).
Prerequisites
You must have Node.js (v20+) and npm installed.
-
Clone the repository
git clone https://github.com/RyanMaxiemus/second-brain-mcp.git cd second-brain-mcp -
Configure Environment Variables
You will need an OpenAI API key. You can set it as an environment variable:
export OPENAI_API_KEY="YOUR_OPENAI_API_KEY" -
Install Dependencies
Install all necessary Node.js dependencies.
npm install -
Build the Application
Compile the TypeScript code to JavaScript.
npm run build -
Run the Application
Launch the MCP server.
npm startThe server will be running and ready to accept connections from an MCP client.
🤝 Contributing
Found a bug? Have an idea for a new feature? We welcome all contributions!
- Open an Issue: Before submitting a Pull Request, please open an issue to discuss the bug or feature you're working on. This helps prevent duplicate work and ensures alignment with the project's goals.
- Fork and Branch: Fork the repository and create a new branch for your contribution.
- Code and Commit: Write clean, well-documented code. Commit messages should be descriptive and follow a conventional format (e.g.,
feat: add support for local embeddings). - Submit a PR: Submit a Pull Request against the
mainbranch. We'll review it as quickly as possible.
Let's make Second Brain the most intuitive code search tool available, together.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.