filter-mcp-server
Approximate Filters using MCP Servers
Overview
This project compares several approximate filter data structures using MCP servers and LLM tool calls.
Approximate filters reduce memory usage by storing compressed summaries instead of full keys.
Because of this trade-off, some filters may return false positives or support limited operations.
The project compares:
Bloom Filter
Counting Bloom Filter
Cuckoo Filter
SuRF (Simplified Version)
An exact hash-set server is also included as a baseline for comparison.
Related MCP server: HydraMCP
Implemented MCP Servers
MCP Server | Data Structure | Description |
| Exact Set / Hash Table | Exact membership baseline |
| Bloom Filter | Memory-efficient approximate membership filter |
| Counting Bloom Filter | Bloom Filter with deletion support |
| Cuckoo Filter | Fingerprint-based approximate filter |
| Simplified SuRF | Approximate prefix/range filter |
Project Goal
The goal of this project is to compare how different filter structures behave under the same workload.
The comparison focuses on:
membership query accuracy
false positive rate
memory usage
query latency
insertion and deletion support
prefix and range query capability
All servers expose the same ADT-style interface through MCP tools so that they can be tested consistently.
Scenario
Search Keyword Dictionary Management
The servers simulate a keyword search system.
Examples:
search autocomplete
keyword lookup
blocked-word checking
dictionary membership testing
The same keyword dataset and queries are used across all filters to compare performance and behavior.
ADT
All MCP servers provide the following tools:
Tool | Description |
| Build filter from dataset |
| Insert a key |
| Membership query |
| Delete a key if supported |
| Range query |
| Prefix query |
| Return estimated memory usage |
| Measure false positive rate |
Structure Comparison
Structure | False Positives | Delete Support | Prefix/Range Query | Memory Efficiency |
Exact Set | No | Yes | Yes | Low |
Bloom Filter | Yes | No | No | Very High |
Counting Bloom Filter | Yes | Yes | No | High |
Cuckoo Filter | Yes | Yes | No | High |
Simplified SuRF | Yes | No | Yes | Medium |
Notes
filter-naiveis included as the exact baseline.The SuRF server is a simplified educational implementation, not a full LOUDS-based production SuRF.
The project focuses on comparison and experimentation rather than production optimization.
Example Claude Desktop MCP Configuration
{
"mcpServers": {
"filter-naive": {
"command": "python",
"args": ["src/filter_/filter_naive_server.py"]
},
"filter-bloom": {
"command": "python",
"args": ["src/filter_/filter_bloom_server.py"]
},
"filter-counting-bloom": {
"command": "python",
"args": ["src/filter_/filter_counting_bloom_server.py"]
},
"filter-cuckoo": {
"command": "python",
"args": ["src/filter_/filter_cuckoo_server.py"]
},
"filter-surf": {
"command": "python",
"args": ["src/filter_/filter_surf_server.py"]
}
}
}System Flow
Claude / LLM
↓
MCP Tool Call
↓
mcp_server.py
↓
registry.py
↓
Selected Filter Class
↓
Bloom / Counting Bloom / Cuckoo / SuRF / Exact SetFlow Description
The LLM sends an MCP tool request.
mcp_server.pyexposes the common ADT-style tools.registry.pyselects the requested filter implementation.The selected filter processes the query.
The result is returned back through the MCP server.
This design allows all filters to be tested through the same interface and workload.
Repository Structure
src/
├── filter_/
│ ├── filter_naive_server.py
│ ├── filter_bloom_server.py
│ ├── filter_counting_bloom_server.py
│ ├── filter_cuckoo_server.py
│ └── filter_surf_server.py
│
└── membership_filters/
├── base.py
├── hashing.py
├── mcp_server.py
├── registry.py
└── filters/Maintenance
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/chohyerinn/filter-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server