An AI-driven coding companion powered by Gemini, LangGraph, and MCP — built for developers who want an intelligent, context-aware terminal assistant.
- AI-Powered Assistance: Leverages Gemini API (Gemini 2.5 Flash) for intelligent code understanding and generation
- Tool Integration: Connects to external tools via Model Context Protocol (MCP)
- Filesystem operations (read, write, search files)
- GitHub integration (with token support)
- Web search via Tavily API (1,000 free searches/month, no credit card!)
- Conversation Memory: Maintains context across interactions with PostgreSQL database
- Clean CLI Interface: Professional copper-themed command-line interface
- State Management: LangGraph-powered agent workflow for complex task orchestration
- Node.js 18+
- PostgreSQL database
- Gemini API key
- (Optional) GitHub token for GitHub integration
- (Optional) Tavily API key for web search (free, no credit card)
- Clone the repository
git clone <repository-url>
cd claude-code- Install dependencies
npm install- Set up environment variables
Create a .env file in the root directory:
# Database
DATABASE_URL="postgresql://user:password@localhost:5432/claude_code"
# Gemini API
GEMINI_API_KEY="your_gemini_api_key_here"
# Optional: GitHub Integration
GITHUB_TOKEN="your_github_token_here"
# Optional: Tavily Search API (Free 1000 searches/month, no CC!)
# Get your free key at: https://tavily.com
TAVILY_API_KEY="your_tavily_api_key_here"- Set up the database
npm run db:migrate- Build the project
npm run buildnpm startOnce the assistant is running:
/help- Show available commands/tools- List all connected tools/exit- Exit the application
You: read the files in this project and summarize it
You: create a new file called test.js with a hello world function
You: search for TODO comments in all files
claude-code/
├── src/
│ ├── agent/ # LangGraph state machine
│ │ ├── graph.ts # State graph definition
│ │ ├── nodes.ts # Node implementations
│ │ └── state.ts # State schema
│ ├── services/ # Business logic services
│ │ ├── gemini.service.ts # Gemini API integration
│ │ ├── mcp.service.ts # MCP server management
│ │ └── conversation.service.ts # Database operations
│ ├── cli/ # Command-line interface
│ │ └── interface.ts
│ ├── db/ # Database setup
│ │ └── prisma.ts
│ └── index.ts # Application entry point
├── prisma/
│ └── schema.prisma # Database schema
└── package.json
- User Input → CLI Interface
- LangGraph State Machine:
- User Input Node: Saves message to database
- Model Node: Claude decides to respond or use tools
- Tool Node: Executes MCP tools, loops back if needed
- Database → Stores conversations, messages, and tool executions
- Response → Displayed to user
- Conversation: Stores conversation metadata
- Message: Individual messages (user, assistant, tool)
- ToolExecution: Logs of tool calls with input/output
- StateCheckpoint: State snapshots for debugging
npm run dev # Run in development mode with auto-reload
npm run build # Compile TypeScript to JavaScript
npm start # Run the compiled application
npm run db:migrate # Run database migrations
npm run db:studio # Open Prisma Studio (database GUI)The assistant connects to the following MCP servers:
- @modelcontextprotocol/server-filesystem: File operations
- @missionsquad/mcp-github: GitHub integration (optional, requires token)
- @tavily/tavily-mcp-server: AI-powered web search (optional, 1000 free searches/month)
Servers are automatically installed via npx when the application starts.
The CLI uses a consistent copper color scheme (#CD6F47) for a professional appearance:
- ASCII art banner
- Success indicators
- Status messages
- Tool execution feedback
- Automatically loads last 10 messages for context
- Prevents token overflow with message limiting
- Persistent storage in PostgreSQL
- Silent error handling for clean user experience
- Graceful shutdown on SIGINT/SIGTERM
- EPIPE error suppression for MCP transport
Edit src/index.ts to change the number of messages loaded:
const conversationHistory = await conversationService.getConversationMessages(
conversation.id,
10 // Change this number
);Edit src/index.ts to add new MCP server connections:
await mcpService.connectServer('server-name', 'npx', [
'-y',
'package-name',
...args,
]);Contributions are welcome! Please feel free to submit a Pull Request.
[Your License Here]
- Gemini API by Google
- LangGraph.js for agent orchestration
- Model Context Protocol for tool integration
- Prisma for database management