Access Network Config Audit Agent

Access Network Config Audit Agent

A read-only MCP server exposing GPON access-network tools for inventory, status, configuration diff, and alarms, enabling a LangGraph agent to audit ONT provisioning against a golden baseline. It runs against a simulated network and enforces read-only constraints at multiple levels.

Category
访问服务器

README

Access Network Config Audit Agent

An MCP server exposing read-only GPON access-network operations, and a LangGraph agent that uses it to audit ONT configuration against a golden baseline.

This runs against a simulated network. There is no real OLT, no real ONT, and no vendor equipment involved. The device layer is a SQLite database seeded with a small synthetic topology. Optical and profile values are modelled on ITU-T G.984 class B+ conventions but are not taken from any operator's production standard. See Limitations.


Why this exists

Configuration drift is a real operational problem in broadband access networks: ONTs get provisioned by hand, migrations leave legacy profiles behind, and a mis-set service VLAN can sit undetected until it causes an incident. Auditing it is exactly the kind of repetitive, well-specified work an agent should be good at — if the agent is built so that its findings can be trusted.

This project is an experiment in that "if".


Architecture

┌──────────────────┐
│  LangGraph agent │   decides what to inspect, correlates alarms
│  (LLM)           │   with findings, writes the report
└────────┬─────────┘
         │  LangChain StructuredTools (agent/mcp_bridge.py)
┌────────▼─────────┐
│   MCP server     │   5 read-only tools, stdio transport
│  (protocol)      │   read_only_hint=True on every tool
└────────┬─────────┘
         │
    ┌────┴─────┬──────────────┐
    │          │              │
┌───▼────┐ ┌───▼──────────┐ ┌─▼─────────────┐
│ OltAcc │ │ audit engine │ │ golden config │
│ (data) │ │ (pure code)  │ │   (YAML)      │
└────────┘ └──────────────┘ └───────────────┘

Three design decisions

1. The LLM does not decide compliance

The comparison between running config and golden baseline happens in audit/engine.py — ordinary, pure, unit-tested Python. The model orchestrates (which devices, which order, how to explain a finding) but never returns the verdict itself.

The reason is that an audit which gives different answers to the same input is not evidence of anything. tests/test_audit.py asserts the engine finds exactly the nine deviations planted by the seed script, and that repeated runs are byte-identical. None of that would be assertable if the logic lived in a prompt.

This also bounds the failure mode: the engine can only report deviations on fields that were actually retrieved, so the agent cannot invent a finding about a device that does not exist.

2. Read-only by design, and the constraint is checked

There is no set_config, no reboot, no provision. The absence is the point. An agent with a write path into a production access network can take subscribers off-line from one bad inference, and a prompt instruction is not a control.

The constraint is enforced at three levels rather than asserted once:

Level Mechanism
Data layer OltAccess exposes no write method at all
Protocol every tool carries read_only_hint=True, destructive_hint=False
Client MCPToolset.assert_read_only() refuses to start the agent if the server ever advertises a mutating tool

Remediation is emitted as a recommendation for a human to execute through change control. The system prompt forbids claiming an action was applied.

Extending this to writes would need, at minimum: a separate server with its own credentials, an explicit approval step in the call path, a dry-run mode, and per-call audit logging. That is deliberately out of scope.

3. MCP rather than direct function-calling

Binding these five functions straight into one agent's tool schema would have been less code. MCP was chosen because:

  • The server is testable on its own. tests/test_mcp_server.py drives it over real stdio with no model involved — the tool contract is verified independently of whichever LLM happens to call it.
  • The device layer is swappable without touching the agent. Replacing the simulator with GenieACS, NETCONF, or a vendor CLI means reimplementing OltAccess only.
  • The same server is reusable by a different agent, a different model, or an operator's desktop MCP client.
  • Capability boundaries are declared in the protocol, not buried in prompt text.

Golden baseline

audit/golden_config.yaml is the single source of truth for correct provisioning, versioned alongside the code. An audit result is only defensible if the baseline it was measured against is itself reviewable and diffable.

Severity model:

Severity Meaning Example rules
critical Service-affecting now, or an isolation/security violation vlan_mismatch, srv_profile_unapproved, admin_disabled, rx_power_out_of_range
major Policy violation with degraded service or SLA risk line_profile_unapproved, dba_profile_unapproved, gem_port_count
minor Hygiene, documentation, or planning deviation description_convention, distance_exceeded, rx_power_marginal

Tool surface

Tool Purpose
list_onts(olt_id?, pon_port?) Inventory discovery
get_ont_status(serial) Operational state, Rx power, ranging distance
get_running_config(serial) Configuration-bearing fields
diff_against_golden(serial) Deterministic compliance verdict + findings
get_alarms(olt_id, active_only) Active/cleared faults for correlation

Running it

python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt

# 1. Seed the simulated network (2 OLTs, 14 ONTs, 9 planted deviations)
python simulator/seed.py

# 2. Verify every layer — none of these need an API key
python tests/test_audit.py         # audit engine determinism + correctness
python tests/test_mcp_server.py    # MCP contract over real stdio
python tests/test_bridge.py        # MCP -> LangChain conversion + guardrail

# 3. Run the agent (needs an Anthropic API key)
export ANTHROPIC_API_KEY=...
python agent/audit_agent.py --olt OLT-BDG-GGK-01

The MCP server can also be attached to any MCP client directly:

python mcp_server/server.py     # stdio transport

Limitations

Stating these plainly matters more than the demo does.

  1. The network is simulated. No GPON hardware, no vendor CLI, no OMCI. The simulator models the shape of ONT provisioning data, not any real OLT's command syntax or YANG model.
  2. The golden baseline is invented. Profile names, VLAN ranges, and the naming convention are plausible but fictional. A real deployment's baseline would come from the operator's provisioning standard.
  3. One use case only. Configuration audit. Fault handling, device configuration, and network optimisation are not implemented.
  4. No scale testing. 14 ONTs. A real PON port carries up to 64 ONTs and a regional OLT thousands; per-device tool calls would not be the right shape at that size — a batch audit tool returning aggregated findings would be.
  5. Alarm correlation is left to the model. The engine does not join alarms to findings; the agent is asked to notice the overlap. That part is therefore not deterministic, and it is the weakest link in the output.
  6. No authentication or authorisation. stdio transport, single local user. Any real deployment needs credential scoping per OLT and per operator role.

Layout

simulator/    olt_sim.py    read-only device accessor (swap this for real transport)
              seed.py       synthetic topology with deliberately planted faults
audit/        engine.py     deterministic golden-config diff
              golden_config.yaml
mcp_server/   server.py     5 read-only MCP tools, stdio
agent/        mcp_bridge.py MCP -> LangChain tool conversion + guardrail check
              audit_agent.py LangGraph ReAct agent
tests/        test_audit.py, test_mcp_server.py, test_bridge.py

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选