Federated Search
A federation MCP server that sits in front of multiple memory backends and presents a unified search surface to AI agents, allowing a single query to search across knowledge graphs, session history, and web search.
README
Federated Search
One query, all knowledge. A federation MCP server that sits in front of multiple memory backends and presents a unified search surface to AI agents.
What It Does
Instead of an agent juggling 3-4 MCP connections and deciding which backend to query, federation handles it:
Agent → fed_search("Kronos") → Federation
├→ Knowledge Graph (curated entities)
├→ Flex (session history)
└→ SearXNG (web, opt-in)
← merged, ranked, one response
Results are priority-ordered by bank, relevance-ranked within each bank, and filtered for signal quality.
Tools
fed_search(query, db?, limit?, mode?, domain?)
Search across all subscribed memory banks.
| Parameter | Default | Description |
|---|---|---|
query |
required | What to search for |
db |
all defaults | Bank ID or comma-separated IDs. "knowledge_graph", "flex,web" |
limit |
10 | Max results. -1 for unlimited |
mode |
"broad" |
"broad", "exact" (phrase match), or "semantic" (meaning-based) |
domain |
none | Pre-filter KG results to an index alias. "infrastructure", "api" |
fed_banks()
Returns registered banks with priorities, descriptions, and health status.
Architecture
federation/
server.py # FastMCP server — tool definitions
federation.py # Core engine — fan-out, merge, rank
config.py # YAML config loader
types.py # FederatedResult envelope, BankConfig, SearchRequest
filters.py # Signal quality — confidence floor, adaptive count, dedup
formatter.py # Markdown output formatting
plugins/
base.py # BankPlugin ABC
kg.py # Knowledge graph MCP plugin
flex.py # Flex session history plugin
searxng.py # SearXNG web search plugin
Plugin System
Each backend is a plugin that translates fed_search into native queries and packs results into a universal envelope:
class MyPlugin(BankPlugin):
async def search(self, query, limit=10, mode="broad", domain=None):
# Call your backend, return list[FederatedResult]
async def health_check(self):
# Return BankStatus.HEALTHY / DEGRADED / DOWN
Adding a new bank = write a plugin class + add a YAML config block. No core changes.
See skills/federation-plugin-dev.md for the full plugin development guide.
Signal Quality
- Query validation — rejects empty, single-char, and stopword queries
- Confidence floor — results below 0.25 relevance get cut
- Adaptive count — when strong results exist, weak tail is trimmed with a note
- Bank representation — each bank gets at least 1 result slot
- Cross-bank annotation — flex chunks referencing KG entities get
overlaps_withmetadata
Config
config.yaml defines agents and their bank subscriptions:
agents:
my_agent:
port: 4001
banks:
- id: knowledge_graph
type: kg
label: "Curated Knowledge"
description: "Agent-curated structured knowledge graph"
priority: 1 # lower = results sort first
default: true # searched when no db= specified
url: "http://127.0.0.1:3101/mcp"
auth: "Bearer ${KG_AUTH_TOKEN}"
- id: web
type: searxng
priority: 99
default: false # opt-in only
url: "http://your-searxng:8080"
Copy config.yaml to config.local.yaml and fill in real values. The local config is gitignored.
Setup
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
# stdio mode (for Claude Code MCP)
python -m federation.server --agent my_agent --config config.local.yaml
# HTTP mode
python -m federation.server --agent my_agent --config config.local.yaml --http --port 4001
Add to Claude Code
claude mcp add fed-search -s user -- \
/path/to/.venv/bin/python -m federation.server \
--agent my_agent --config /path/to/config.local.yaml
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。