Open-source MCP server monitoring for Python apps

Pythonic Model Context Protocol servers handle tool calls, session events, module imports, and subprocess activity. BlueRock has released MCP Python Hooks, an open source runtime sensor that gives developers a way to capture those signals without modifying application code.

MCP server monitoring

What the sensor captures

The tool wraps a Python process at startup so its hooks initialize before application code executes. According to BlueRock CEO Harold Byun, this is achieved through Python-native mechanisms: audit hooks for security-sensitive operations, sys.meta_path import hooks for module visibility, and framework-specific hooks built on the wrapt library for MCP protocol activity. The wrapper avoids any SDK integration or code edits.

Once active, the sensor emits structured NDJSON events to a local spool directory at ~/.bluerock/event-spool/. Six MCP event types are supported in this release, covering server initialization, tool and resource registration, session creation and termination, client connections across stdio, HTTP, and SSE transports, and individual protocol messages. Each emitted event includes process ID, timestamps, and a per-process source event counter.

Import monitoring runs alongside the MCP hooks. Every loaded module produces a python_import event recording the module name, file path, package version where available, and a SHA-256 hash of the module file on disk. Coverage extends to direct dependencies and their transitive dependencies, which the project documents as a supply-chain visibility feature.

Mechanism and overhead

Byun said overhead depends on event volume and export configuration, and the capture layer is designed to be lightweight. Framework hooks load lazily through @wrapt.when_imported(), so libraries the application never imports incur no cost. A per-feature configuration gate adds a second layer of control, letting operators disable categories they do not need.

The sensor runs on Python 3.10 and later. Pre-built wheels target Linux on x86_64 and aarch64 and macOS on both Apple Silicon and Intel. The Rust-based event-writing backend ships as a separate package called bluerock-oss.

Boundaries of the open source release

“The OSS release is primarily focused on visibility: capturing structured MCP and Python runtime events so teams can understand what executed,” Byun said. “Operators can control which hook categories are enabled, which limits what is captured at the source. More granular redaction and filtering, such as per-tool or per-field handling, are not part of the initial OSS scope.”

He added that the same execution data forms the basis for real-time policy enforcement and guardrails in the paid platform.

Integration paths

Because events are written as NDJSON, downstream routing is left to the operator. The repository ships with a Grafana and Loki dashboard that runs locally through Docker Compose, and BlueRock points to OTLP forwarding for users feeding events into Datadog, Splunk, or other SIEM systems.

Jeremiah Lowin, CEO of Prefect and creator of FastMCP, said in a statement provided by BlueRock that teams have moved quickly to adopt MCP and agent-driven architectures, and that visibility into tool executions and runtime behavior has lagged that adoption. Byun said tool execution visibility for governing the agentic execution layer is becoming a requirement for teams operating MCP infrastructure in production.

BlueRock MCP Python Hooks is available for free on GitHub.

Must read:

Subscribe to the Help Net Security ad-free monthly newsletter to stay informed on the essential open-source cybersecurity tools. Subscribe here!

Source link

Visited 2 times, 1 visit(s) today

Related Article

A motorised auto-rickshaw powered by liquefied petroleum gas (LPG) passes a bridge amid rising fuel and LPG prices due to the Iran conflict, in Karachi, Pakistan. (Reuters)

Pakistan reopens Gabd-Rimdan border with Iran after week-long trade halt

Pakistan reopened a key border crossing with Iran to resume bilateral trade and cross-border movement after a week-long suspension that stranded freight vehicles, disrupted supplies and aggravated concerns over LPG shortage ahead of winter. A motorised auto-rickshaw powered by liquefied petroleum gas (LPG) passes a bridge amid rising fuel and LPG prices due to the

A Boeing 787 Dreamliner of Riyadh Air at King Khalid International Airport in Riyadh.

The Saudi Airline That Launched Right in the Middle of a War

The day after a missile hit the airport where Riyadh Air’s offices are based, the British boss of Saudi Arabia’s new airline wanted to soothe staff fears. A Boeing 787 Dreamliner of Riyadh Air at King Khalid International Airport in Riyadh. “We would never operate a flight or have people work in a building if

Stock Market Sell-Off: History Says This Is the Best Move to Make Right Now

So your portfolio is redder than a stoplight, and your AI stocks are doing their best impression of a deflating balloon. The Nasdaq Composite (^IXIC -0.21%) has fallen 7.6% from its early October highs, dragging other market indicators lower. Pullbacks of this magnitude tend to rattle investors, particularly those who piled into artificial intelligence plays

What the New Class C Share Structure Actually Means for Meta Platforms Stock Investors

Meta Platforms (META) is introducing non-voting Class C shares to widen its options for raising capital, rewarding employees, and financing acquisitions without weakening CEO Mark Zuckerberg’s voting control. On Wednesday, Oct. 21, the board approved the charter amendment alongside its Q3 results, with a revised certificate of incorporation scheduled to take effect on Tuesday, Jan.

5 Oversold AI Stocks: Where Wall Street Analysts Are Spotting 50%+ Upside

The AI selloff has opened a wide gap between share prices and Wall Street’s expectations. Some of the stocks below have lost nearly half their value in 30 days, while their average analyst targets still imply gains well above 50%. It sounds like an opportunity but can also mean the market has moved faster than

Is Nike Still a Growth Stock? Here’s the Answer.

By now, Nike (NYSE: NKE) shareholders are well aware that the company’s fiscal 2027 could be a tough stretch. In the company’s 2027 first-quarter earnings report, revenue fell 4% year over year to $11.2 billion, and net income slid 2% to $712 million. The athletic wear giant has been in the midst of a turnaround

Banner

UK police arrest 15-year-old boy for photoshopping local politician into rabbit

West Midlands Police in the United Kingdom, on August 3, detained a 15-year-old boy identified only as Fraser, for allegedly mocking a local politician, Simon Bennett, in social media posts, including one that photoshopped him into a rabbit. Police officers stormed the teenager’s family home in the early hours of the day while he was

Jim Cramer’s Case for “Accidental High Yielders” When the Fed Shakes the Market

Quick Read Verizon’s 6.3% yield is backed by strong coverage, with dividends consuming only 57% of EPS guidance and 58% of first-half free cash flow. T. Rowe Price’s quarterly dividend grew from $1.24 to $1.30 while its share price fell 37%, but $56.9 billion in 2025 client outflows signal real business damage. Cramer calls accidental

Verizon (VZ) Stock Looks Reasonable After A 62% Three Year Gain

Verizon Communications has delivered a strong multi year share price gain, leaving investors asking whether the current US$44.66 stock price is fully supported by the earnings the business is generating today. Over the past 3 years the stock has returned 62.4%, which puts more weight on the question of how closely its market value now

Air pollution, chemicals fuelling South Asia’s diabetes and heart disease crisis: Lancet paper

Diet and sedentary lifestyle only explain part of South Asia’s health epidemic. A new paper on Lancet argues that environmental exposure, including air pollution, endocrine-disrupting chemicals, and climate-related stress, is driving the surge in diseases Excess calorie consumption and physical inactivity are often cited as the main drivers of obesity, diabetes and heart disease. Yet,

0
Would love your thoughts, please comment.x
()
x