APLCart MCP Server

APLCart MCP Server

An MCP server providing access to the APLCart idiom collection with semantic search and syntax matching capabilities. It enables users to find APL expressions and idioms through natural language queries, keyword searches, and exact syntax lookups.

Category
Visit Server

README

APLCart MCP Server

A Model Context Protocol (MCP) server that exposes the APLCart idiom collection with semantic search capabilities. APLCart is a searchable collection of APL expressions with descriptions.

Features

  • Find APL expressions by exact syntax match
  • Search across syntax, descriptions, and keywords
  • Get keywords for specific APL expressions
  • Natural language queries using OpenAI embeddings

Installation

Prerequisites

  • Python 3.11 or higher
  • OpenAI API key (for semantic search functionality)

Using uv

# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh

# Clone the repository
git clone <repository-url>
cd ac-mcp

# Install dependencies
uv sync

Setup

Convert APLCart Data

First, fetch and convert the APLCart TSV data to JSONL format:

# Using uv
uv run python aplcart2json.py

# Or with activated venv
python aplcart2json.py

# Optional: Generate SQLite database for faster searches
python aplcart2json.py --db

Generate Embeddings (Optional; for Semantic Search)

To enable semantic search functionality:

# Set your OpenAI API key
export OPENAI_API_KEY='your-api-key-here'

# Generate embeddings
uv run python generate_embeddings.py

# Or with activated venv
python generate_embeddings.py

This creates:

  • aplcart.index - FAISS index file containing embeddings
  • aplcart_metadata.pkl - Metadata for semantic search results

Usage

Running the MCP Server

# Basic usage
uv run python aplcart_mcp_semantic.py

# With SQLite database backend
APLCART_USE_DB=1 uv run python aplcart_mcp_semantic.py

Using with Claude Code

The project includes a .mcp.json.template file that automatically configures the MCP server. Save that as .mcp.json, update it with your details, and run /mcp in Claude Code to see available servers.

You can also manually add the server:

claude mcp add aplcart "uv run python aplcart_mcp_semantic.py"

Using with Claude Desktop

Add this to your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/claude/claude_desktop_config.json
{
  "mcpServers": {
    "aplcart": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "YOUR/PATH/HERE/ac-mcp",
        "python",
        "aplcart_mcp_semantic.py"
      ],
      "env": {
        "APLCART_USE_DB": "1",
        "OPENAI_API_KEY": "${OPENAI_API_KEY}"
      }
    }
  }
}

Then restart Claude Desktop to load the MCP server.

Available MCP Tools

  • lookup-syntax - Exact match on APL syntax

    Example: lookup-syntax "⍳10"
    
  • search - Substring search across syntax, description, and keywords

    Example: search "matrix" limit=10
    
  • keywords-for - Get keywords for a specific syntax

    Example: keywords-for "∘.≤⍨∘⍳"
    
  • semantic-search - Natural language search using embeddings

    Example: semantic-search "how to split a string on a separator"
    

Standalone Search Tool

You can also use the semantic search functionality directly:

# Interactive mode
uv run python search_embeddings.py

# Single query
uv run python search_embeddings.py "find the largest number"

# JSON output
uv run python search_embeddings.py "reverse an array" --json

# More results
uv run python search_embeddings.py "matrix operations" -k 10

Interactive mode commands:

  • Type your query and press Enter to search
  • Type quit, exit, or q to exit (or Ctrl+D or Ctrl+C)

Configuration

Environment Variables

  • OPENAI_API_KEY - Required for semantic search functionality
  • APLCART_USE_DB - Set to 1, true, or yes to use SQLite database backend

File Structure

ac-mcp/
├── aplcart.jsonl           # Converted APLCart data (run aplcart2json.py to generate)
├── aplcart.db              # SQLite database (optional)
├── aplcart.index           # FAISS embeddings index (run generate_embeddings.py to generate)
├── aplcart_metadata.pkl    # Metadata for semantic search (run generate_embeddings.py to generate)
├── aplcart2json.py         # Converter script
├── generate_embeddings.py  # Embedding generator
├── aplcart_mcp_semantic.py # MCP server with semantic search
├── search_embeddings.py    # Standalone search tool
└── pyproject.toml          # Project dependencies

About APLCart

APLCart is a searchable collection of APL idioms and expressions maintained at https://aplcart.info/

License

This project is licensed under the MIT License - see the LICENSE file for details.

Note: The APLCart data itself is subject to its own licensing terms.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured