The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Filter MCP Server listing page.
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:
An exact hash-set server is also included as a baseline for comparison.
| MCP Server | Data Structure | Description |
|---|---|---|
filter-naive | Exact Set / Hash Table | Exact membership baseline |
filter-bloom | Bloom Filter | Memory-efficient approximate membership filter |
filter-counting-bloom | Counting Bloom Filter | Bloom Filter with deletion support |
filter-cuckoo | Cuckoo Filter | Fingerprint-based approximate filter |
filter-surf | Simplified SuRF | Approximate prefix/range filter |
The goal of this project is to compare how different filter structures behave under the same workload.
The comparison focuses on:
All servers expose the same ADT-style interface through MCP tools so that they can be tested consistently.
The servers simulate a keyword search system.
Examples:
The same keyword dataset and queries are used across all filters to compare performance and behavior.
All MCP servers provide the following tools:
| Tool | Description |
|---|---|
build(items) | Build filter from dataset |
insert(x) | Insert a key |
contains(x) | Membership query |
delete(x) | Delete a key if supported |
range_query(lo, hi) | Range query |
prefix_query(prefix) | Prefix query |
memory_usage() | Return estimated memory usage |
false_positive_rate() | Measure false positive rate |
| 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 |
This table describes the expected qualitative behavior of each structure. It is not a measured benchmark result.
Measured results are available in docs/benchmark_results.md.
The benchmark uses fixed synthetic workloads from src/membership_filters/benchmark.py and compares all filters with the same build items and absent-query probes. It reports estimated memory from memory_usage(), measured false positive rate from false_positive_rate(), and average local contains() latency.
Run it locally:
Run the smoke tests:
filter-naive is included as the exact baseline.mcp_server.py exposes the common ADT-style tools.registry.py selects the requested filter implementation.This design allows all filters to be tested through the same interface and workload.