Catalog PyPI
PACKAGE EXPLORERView in registry

ai-cogence-tools

PyPI

MCP Tools for AI Cogence - Expose AI capabilities via Model Context Protocol

aimcpmodel-context-protocolragtools
Versions collected1
Direct dependencies10From release 1.1.0
Last observed21 Oct, 10:14 UTC

README

Version 1.1.0 documentation

AI Cogence MCP Tools

Expose AI Cogence capabilities as MCP (Model Context Protocol) tools that can be used in Claude Desktop and other MCP clients.

What is This?

This package provides 7 AI tools that you can use in MCP-compatible applications:

  • rag_query - AI-powered Q&A with sources
  • semantic_search - Vector similarity search
  • list_chat_sessions - Session management
  • get_session_messages - Message history
  • get_analytics - Usage metrics
  • search_knowledge_base - Keyword search
  • ingest_documents - Ingest documents from S3 into vector database

Installation

pip install ai-cogence-tools

Configuration

Create a .env file with your backend credentials:

POSTGRES_USER=your_user
POSTGRES_PASSWORD=your_password
POSTGRES_HOST=your_host
POSTGRES_PORT=5432
POSTGRES_DB=your_db
OPENAI_API_KEY=sk-...

Usage with Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on Mac):

{
  "mcpServers": {
    "ai-cogence-tools": {
      "command": "ai-cogence-tools",
      "env": {
        "POSTGRES_USER": "your_user",
        "POSTGRES_PASSWORD": "your_password",
        "POSTGRES_HOST": "your_host",
        "POSTGRES_DB": "your_db",
        "OPENAI_API_KEY": "sk-..."
      }
    }
  }
}

Restart Claude Desktop. The tools will appear in the tools menu.

Usage Programmatically

from mcp import ClientSession, StdioServerParameters
from mcp.client.stdio import stdio_client

# Connect to the server
server_params = StdioServerParameters(
    command="ai-cogence-tools",
    env={
        "POSTGRES_USER": "your_user",
        "POSTGRES_PASSWORD": "your_password",
        # ... other env vars
    }
)

async with stdio_client(server_params) as (read, write):
    async with ClientSession(read, write) as session:
        # Initialize
        await session.initialize()
        
        # List available tools
        tools = await session.list_tools()
        print(f"Available tools: {[tool.name for tool in tools.tools]}")
        
        # Call a tool
        result = await session.call_tool("rag_query", {
            "question": "What is RAG?"
        })
        print(result.content)

Available Tools

rag_query

Execute a RAG query to get AI-powered answers with sources.

Arguments:

  • question (required): The question to ask
  • session_id (optional): Session ID for conversation context

Perform semantic search using vector embeddings.

Arguments:

  • query (required): Search query
  • top_k (optional, default=5): Number of results

list_chat_sessions

List all chat sessions with metadata.

Arguments:

  • limit (optional, default=20): Maximum sessions to return

get_session_messages

Get all messages for a specific session.

Arguments:

  • session_id (required): Session ID

get_analytics

Get usage analytics and metrics.

Arguments:

  • time_range (optional, default="today"): Time range (today, week, month, all)

search_knowledge_base

Search the knowledge base using keywords.

Arguments:

  • query (required): Search query
  • limit (optional, default=10): Maximum results

ingest_documents

Ingest documents from S3 bucket into the vector database. Loads documents, chunks them, creates embeddings, and stores them for RAG queries.

Arguments:

  • force_refresh (optional, default=false): Force refresh even if documents are already ingested

What it does:

  • Loads documents from S3 bucket
  • Chunks documents for optimal retrieval
  • Creates vector embeddings
  • Stores in PostgreSQL with pgvector
  • Syncs with existing vectors (adds new, removes obsolete)

How It Works

This MCP server connects to the AI Cogence backend and exposes its capabilities as tools. It:

  1. Uses existing backend services (no code duplication)
  2. Connects to your PostgreSQL database with pgvector
  3. Uses OpenAI for embeddings and completions
  4. Provides RAG, search, and analytics capabilities

Requirements

  • Python 3.10+
  • PostgreSQL with pgvector extension
  • OpenAI API key
  • Access to AI Cogence backend database

License

MIT

Support

For issues or questions, visit: https://github.com/ai-cogence/mcp-tools/issues

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.1.08 Oct 202510

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
ai-cogence/mcp-tools

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 10:14 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:1481460ae0be6299316e4fbd31d033221f80b7a1040964d0d93bdecc2c6cb6bb