πŸ¦… Saqr-MCP

by ahmedhassan456

2 stars
163 downloads
Not rated
GitHub

About

Saqr-MCP is a powerful Python application that implements the Model Context Protocol (MCP) to enable advanced AI assistant capabilities. It supports both local models through Ollama and cloud models through Groq, providing a flexible client-server architecture

Details

Author
ahmedhassan456
GitHub stars
2
Downloads
163
Categories
AI

- Interactive chat interface for querying models
- Support for local models (Ollama) and cloud models (Groq)
- Advanced web search capabilities using Tavily API
- Word document generation from markdown content
- Comprehensive memory management system using mem0
- Advanced reasoning and thought process tracking

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name πŸ¦… Saqr-MCP
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Install dependencies with UV, configure environment variables (API keys for Tavily, Groq, Mem0; Ollama model name), and run python main.py. Type queries in the interactive console; use quit to exit. To use Groq instead of Ollama, modify main.py to import from src.groq_client.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\ud83e\udd85 saqr-mcp": {
            "Saqr-MCP": {
                "command": "uv",
                "args": [
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "Saqr-MCP": {
        "command": "uv",
        "args": [
            "venv"
        ]
    }
}

<div align="center">
<h1>πŸ¦… Saqr-MCP</h1>

Python Version
License
UV Package Manager

<p align="left">
Saqr-MCP is a powerful Python application that implements the Model Context Protocol (MCP) to enable advanced AI assistant capabilities. It supports both local models through Ollama and cloud models through Groq, providing a flexible client-server architecture. The server component offers a rich set of tools including web search, memory management, document generation, and advanced reasoning capabilities.</p>

image
</div>

✨ Features

- πŸ€– Interactive chat interface for querying models
- πŸ”„ Support for both local models (Ollama) and cloud models (Groq)
- πŸ” Advanced web search capabilities using Tavily API
- πŸ“ Word document generation from markdown content
- 🧠 Comprehensive memory management system using mem0
- πŸ’­ Advanced reasoning and thought process tracking
- ⚑ Async architecture for efficient processing
- 🎨 Visual loading animations for better user experience
- πŸ“Š Session-based thought logging and analysis
- πŸ“„ Document generation with markdown support

πŸ“‹ Prerequisites

- 🐍 Python 3.11 or higher
- πŸ¦™ Ollama installed with local models (for local model usage)
- πŸ“¦ UV package manager (recommended)

πŸš€ Installation

1. Clone this repository:

   git clone https://github.com/ahmedhassan456/Saqr-MCP.git
   cd saqr-mcp
   

2. Create and activate a virtual environment (optional but recommended):

   uv venv
   # On Windows
   .venv\Scripts\activate
   # On Unix or MacOS
   source venv/bin/activate
   

3. Install dependencies:

   uv add -r requirements.txt
   

4. Set up environment variables:
- Copy .env.example to .env
- Configure the following variables:
- πŸ”‘ MODEL_NAME: Your preferred Ollama model (e.g., qwen3:1.7b)
- πŸ” TAVILY_API_KEY: Your Tavily API key from Tavily website
- ⚑ GROQ_MODEL_NAME: Your preferred Groq model name
- πŸ” GROQ_API_KEY: Your Groq API key from Groq website
- 🧠 MEM0_API_KEY: Your Mem0 API key from Mem0 website

πŸ’» Usage

1. For local model usage, ensure Ollama is running with your chosen model available

2. Configure the client:
- By default, the application uses Ollama client (from src.ollama_client import SaqrMCPClient)
- To use Groq instead, modify main.py to use from src.groq_client import SaqrMCPClient

3. Run the client:

   python main.py
   

4. Type your queries in the interactive console:

   MCP Client Started!
   Type your queries or 'quit' to exit.

Query:

5. Type quit to exit the application

πŸ“ Project Structure

- πŸ“„ main.py - Entry point that starts the MCP client
- πŸ“‚ src/
- πŸ”„ ollama_client.py - MCP client implementation for Ollama models
- ⚑ groq_client.py - MCP client implementation for Groq models
- πŸ› οΈ server.py - MCP server implementation with all tools
- πŸ“ logger.py - Custom logging utilities with visual animations

πŸ› οΈ Available Tools

The server implements a comprehensive set of tools for various functionalities:

πŸ” Web Search and Document Generation

- web_search: Performs real-time web searches using Tavily API to retrieve up-to-date information - word_file_generator: Creates Microsoft Word documents from markdown content with proper formatting

🧠 Memory Management

- add_memory: Stores new memories with specified types and content in mem0 - get_all_memories: Retrieves all stored memories, optionally filtered by type - search_memories: Performs semantic search through stored memories to find relevant information

πŸ’­ Reasoning and Thought Process

- think: Records thoughts and reasoning processes for complex problem-solving - get_thoughts: Retrieves all thoughts recorded in the current session - clear_thoughts: Clears all recorded thoughts from the current session - get_thought_stats: Provides detailed statistics about recorded thoughts

βš™οΈ Environment Variables

| Variable | Description | Default |
|----------|-------------|---------|
| πŸ”‘ OLLAMA_MODEL_NAME | The name of the Ollama model to use (e.g., qwen3:1.7b) | None |
| πŸ” TAVILY_API_KEY | Tavily API Key for web search capabilities | None |
| ⚑ GROQ_MODEL_NAME | The name of the Groq model to use | None |
| πŸ” GROQ_API_KEY | Groq API Key for cloud model access | None |
| 🧠 MEM0_API_KEY | Mem0 API Key for memory management | None |

πŸ“¦ Dependencies

- πŸ”„ mcp[cli] - Model Context Protocol implementation
- 🌐 httpx - HTTP client for Python
- πŸ“ loguru - Python logging made simple
- ⚑ groq - Groq API client
- πŸ¦™ ollama - Interface to Ollama for local models
- πŸ” tavily-python - Search Engine tailored for AI agents
- πŸš€ fastapi - Web framework for building APIs
- ⚑ uvicorn - ASGI server implementation
- πŸ“„ htmldocx - HTML to DOCX converter
- πŸ” duckduckgo-search - Search engine integration
- πŸ“„ python-docx - DOCX file handling
- πŸ“ markdown - Markdown processing
- 🧠 mem0 - Memory management system

πŸ“„ License

MIT

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1. 🍴 Fork the repository
2. 🌿 Create your feature branch (git checkout -b feature/amazing-feature)
3. πŸ’Ύ Commit your changes (git commit -m 'Add some amazing feature')
4. πŸ“€ Push to the branch (git push origin feature/amazing-feature)
5. πŸ”„ Open a Pull Request

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.