architecture

architecture is an agent for coding agents from samanhappy/mcphub. It costs 0 tokens per session (572 once invoked), scanned A, original, Apache-2.0.

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.

Agent

Install

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.

agentmods
npx agentmods add agents/samanhappy/mcphub/architecture
Clone the repo
git clone --depth 1 https://github.com/samanhappy/mcphub

Wrote 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.

agentmods badge for architecture

README.md
[![agentmods](https://agentmods.dev/badge/agents/samanhappy/mcphub/architecture.svg)](https://agentmods.dev/agents/samanhappy/mcphub/architecture)
Your own site
<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>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 572 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured yesterday against content hash eb738bc5e77b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

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.

docs/agents/architecture.md · 39 lines

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.ts starts the process and src/server.ts owns AppServer initialization, route registration, and shutdown.
  • src/services/mcpService.ts owns 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:

  1. src/types/index.ts — shared interface or schema.
  2. src/dao/*Dao.ts — JSON implementation when behavior changes.
  3. src/db/entities/*.ts — TypeORM column; mark optional fields nullable and use simple-json for object values.
  4. src/dao/*DaoDbImpl.ts — database create/update mapping.
  5. src/db/repositories/*.ts — repository wrapper, when it exposes the field.
  6. src/utils/migration.ts — JSON-to-database migration.
  7. 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.

Read the full file on GitHub · 39 lines

Changes

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.

  1. yesterday First seen · 39 lines · 0 tokens per session scan A eb738bc5e77b

Subscribe to this mod's changes

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.

Related

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.

alexmmatos/arthur-mcp · 31 tokens

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.

alexmmatos/arthur-mcp · 31 tokens

fullstack-developer

Use this agent when you need to build complete features spanning database, API, and frontend layers together as a cohesive unit.

alexmmatos/arthur-mcp · 29 tokens

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.

alexmmatos/arthur-mcp · 63 tokens

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.

alexmmatos/arthur-mcp · 52 tokens

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.

alexmmatos/arthur-mcp · 49 tokens