Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/samanhappy/mcphub/architecturegit clone --depth 1 https://github.com/samanhappy/mcphubWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/samanhappy/mcphub/architecture)<a href="https://agentmods.dev/agents/samanhappy/mcphub/architecture"><img src="https://agentmods.dev/badge/agents/samanhappy/mcphub/architecture.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00000 | $0.00572 |
| Opus 5 | $0.00000 | $0.00286 |
| Sonnet 5 | $0.00000 | $0.00114 |
| Haiku 4.5 | $0.00000 | $0.00057 |
Grade A, and why
architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 39 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Architecture and data/auth invariants
Read this guide when changing runtime wiring, MCP connections, HTTP routing, authentication, persistence, or database behavior. For the public runtime overview, see docs/development/architecture.mdx.
Runtime map
src/index.tsstarts the process andsrc/server.tsownsAppServerinitialization, route registration, and shutdown.src/services/mcpService.tsowns the lifecycle of upstream MCP clients.src/routes/defines HTTP routes;src/controllers/implements resource handlers.src/dao/provides file-backed persistence by default;src/db/provides the optional TypeORM/PostgreSQL backend.src/clients/contains upstream MCP client wrappers.src/types/contains shared configuration and domain types.frontend/src/contains the Vite/React dashboard.
Persistence changes
When adding or changing a persisted field, update every applicable layer:
src/types/index.ts— shared interface or schema.src/dao/*Dao.ts— JSON implementation when behavior changes.src/db/entities/*.ts— TypeORM column; mark optional fieldsnullableand usesimple-jsonfor object values.src/dao/*DaoDbImpl.ts— database create/update mapping.src/db/repositories/*.ts— repository wrapper, when it exposes the field.src/utils/migration.ts— JSON-to-database migration.mcp_settings.json— example configuration, when user-facing.
Database mode is selected at startup by the code in src/dao/DaoFactory.ts: USE_DB=true enables it; when USE_DB is unset, a configured DB_URL enables it; an explicit USE_DB=false disables it.
Bearer-key invariant
Bearer keys have explicit kinds. Legacy and operator-created keys use kind: 'system'; user-level keys use kind: 'user' and must have an owner. Do not infer the kind from whether owner is empty. User-level keys restore the owner's live user context on MCP transport requests and are not dashboard API credentials.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 39 lines · 0 tokens per session scan A eb738bc5e77b
architecture is an agent published in the GitHub repository samanhappy/mcphub (2,362 stars, last pushed today), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 572 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-02.
Other agents, from other repositories
database-administrator
Use this agent when optimizing database performance, implementing high-availability architectures, setting up disaster recovery, or managing database infrastructure for production systems.
database-optimizer
Use this agent when you need to analyze slow queries, optimize database performance across multiple systems, or implement indexing strategies to improve query execution.
fullstack-developer
Use this agent when you need to build complete features spanning database, API, and frontend layers together as a cohesive unit.
naming-expert
Expert at naming things consistently and clearly across the codebase — variables, functions, types, components, routes, API endpoints, database columns, MCP tool names, prompt names, and UI labels. Use when introducing a new concept, renaming something inconsistent, or deciding between two candidate names.
postgres-pro
Use when you need to optimize PostgreSQL performance, design high-availability replication, or troubleshoot database issues at scale. Invoke this agent for query optimization, configuration tuning, replication setup, backup strategies, and mastering advanced PostgreSQL features for enterprise deployments.
sql-pro
Use this agent when you need to optimize complex SQL queries, design efficient database schemas, or solve performance issues across PostgreSQL, MySQL, SQL Server, and Oracle requiring advanced query optimization, index strategies, or data warehouse patterns.