
mcp_agent
RAG with Tool Augmented LLM
Repository Info
About This Server
RAG with Tool Augmented LLM
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
MCP Agent with ChromaDB Integration
A powerful tool for converting and querying documents using ChromaDB embeddings with OpenAI and Anthropic Claude integration.
Features
- Convert Word documents to ChromaDB embeddings
- Convert Excel files to ChromaDB embeddings with schema support
- RAG (Retrieval Augmented Generation) system for document querying
- Tool-augmented RAG for advanced analysis
- FastAPI server with Anthropic Claude integration
- Rich CLI interface for document processing
- Support for custom metadata and document chunking
- Python code execution with safety restrictions
- File saving and manipulation capabilities
- Docker support for easy deployment
Prerequisites
- Python 3.8 or higher
- OpenAI API key
- Anthropic API key (for Claude integration)
- Docker and Docker Compose (optional, for containerized deployment)
Installation
Local Installation
- Clone the repository:
git clone https://github.com/kc099/mcp_agent.git
cd mcp_agent
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile in the project root with your API keys:
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
Docker Installation
-
Clone the repository and create
.envfile as described above. -
Build and run using Docker Compose:
docker-compose up --build
Or run in background:
docker-compose up -d
To stop the container:
docker-compose down
Usage
Converting Word Documents
from embeddings.vectordbdoc import main
# Convert a Word document to ChromaDB embeddings
collection, ids = main(
"path/to/your/document.docx",
document_metadata={
"author": "Your Name",
"title": "Document Title",
"tags": ["tag1", "tag2"]
}
)
Converting Excel Files
from embeddings.vectordbexcel import EnterpriseExcelEmbedder
# Initialize the embedder
embedder = EnterpriseExcelEmbedder()
# Analyze Excel and generate schema recommendations
schema_recommendations = embedder.analyze_excel("path/to/your/excel.xlsx")
# Create embeddings using the recommended schema
stats = embedder.embed_excel("path/to/your/excel.xlsx", collection_name_prefix="enterprise")
Running the MCP Server
Local Run
python mcpserver.py
Docker Run
docker-compose up
The server will start on http://localhost:8000
Using the MCP Client
Local Run
python mcpclient.py
Docker Run
The client is automatically started in the Docker container in interactive mode.
Project Structure
embeddings/vectordbdoc.py: Word document to ChromaDB conversionvectordbexcel.py: Excel file to ChromaDB conversion
mcp/tools/: MCP tool implementationspython_execute.py: Safe Python code executionfile_saver.py: File saving and manipulationbrowser_use_tool.py: Browser interactionstr_replace_editor.py: String replacementbash.py: Shell command executionterminate.py: Process termination
mcpclient.py: CLI client for interacting with the MCP servermcpserver.py: FastAPI server with Claude integrationrag.py: RAG system implementationtoolaugmentedrag.py: Tool-augmented RAG systemchromadbquery.py: ChromaDB query utilitiesDockerfile: Docker container definitiondocker-compose.yml: Docker Compose configuration
Docker Volumes
The Docker setup includes persistent volumes for:
/app/config: Configuration files/app/data: Application data/app/chroma_db: ChromaDB database files
API Documentation
Once the server is running, visit http://localhost:8000/docs for the interactive API documentation.
Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Building a Tool-Augmented RAG System with Claude MCP or OpenManus
Instead of directly connecting an LLM to your ChromaDB, you can build a more sophisticated system that uses tools to iteratively analyze and process data. This approach combines the benefits of RAG with the multi-step reasoning capabilities of agents.
Quick Start
Clone the repository
git clone https://github.com/kc099/mcp_agentInstall dependencies
cd mcp_agent
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.