Back to workWork / MCP Hub

MCP Hub

Agent orchestration, project knowledge and reusable experience

Agent infrastructure and integration architecture

The outcome

I use MCP Hub to investigate errors, review communication and trace project activity across databases, logs and work tools. Relevant schemas, stored results and prior methods can be opened as needed, keeping repeated investigations focused.

AI agent infrastructure · Igor Bartenev

A practical example

Investigating a discrepancy across connected services

Consider an agent investigating a stock discrepancy and preparing a follow-up task. It needs relevant data from connected services, enough context to reason, and a clear boundary before changing anything.

Illustrative walkthrough of the implementation

  1. Find relevant tools in the permitted catalog and load only their exact schemas.

  2. Read within a shared budget; keep large responses as stored artifacts with previews.

  3. Check action permissions, obtain approval when required, then retain the execution result.

What this enables

The agent gets a focused working context, while the operator can inspect the action, access decision and recorded result. Approval remains tied to the agreed action and arguments.

Design choice & trade-off

Selective discovery adds a lookup step but avoids loading every integration schema into every request. Previews reduce immediate context size, while full artifacts require explicit retrieval and have retention limits. An uncertain external write stays uncertain; it is not silently reported as success or blindly repeated.

Full context & approach

The challenge

Operational questions span several systems, while broad database access and an ever-growing tool catalog create permission and context problems for agents.

How I approached it

I combined on-demand tool schemas, scoped execution and retained results with local embeddings, full-text retrieval and reusable methods. The native agent runner shares budgets across delegated work, while scheduled workflows use persistent runs and approval states. Knowledge, observed calls and feedback remain separate so later tasks can reuse experience in its original context.

What I owned and delivered

My responsibility

I designed and built the integration layer and native agent runtime, including tool discovery, project knowledge, execution controls and reusable experience.

Delivered capability

  • Local embeddings and hybrid search retrieve relevant knowledge. Tool schemas and stored results open on demand, keeping the working context focused.

  • Agents and persistent automations share scoped execution, approvals, receipts and budgets. Completed work can explicitly contribute reusable methods; this does not train model weights.

Inside MCP Hub

From a question to controlled work

Follow three different requests. Explore the boundaries that keep knowledge, actions and experience separate.

Read the three paths

Modular monolith · responsibility boundaries, not separate services. Illustrative flow. No live tools, data or approvals.

Understand a system

“How does order synchronization work?”

A documentation question can finish with relevant sources. No provider operation or method capture is required.

  1. Project scope

    Resolve the actor, project and permitted resources before choosing a capability. A useful result from another project does not grant access to it.

  2. Project knowledge

    Retrieve relevant source fragments from the project’s effective knowledge bases. Documentation can explain a system without launching a live investigation.

  3. Grounded conclusion

    Return an answer tied to the available sources and observed results. Saving a reusable method is an explicit, optional step after useful work, not automatic learning from every read.

Investigate a mismatch

“Why do these inventory figures disagree?”

This example finds a relevant prior method, then verifies the current state through permitted reads. The prior method is advice, not authority.

  1. Project scope

    Resolve the actor, project and permitted resources before choosing a capability. A useful result from another project does not grant access to it.

  2. Reusable methods

    A relevant previous method can suggest where to look. It is optional advice with applicability and limitations, never a permission or proof that the current task succeeded.

  3. Tool discovery

    Find a relevant capability, then load its exact argument schema. The working context receives what this request needs, not every tool declaration.

  4. Execution boundary

    Validate the actor, scope and exact operation before credentials are used. Where approval is required, bind it to that specific action rather than granting blanket access.

  5. Provider operation

    Dispatch the permitted operation through its provider adapter. Reads, writes and uncertain outcomes retain their own handling; a timed-out write is not blindly repeated.

  6. Execution evidence

    Inspect the result and its execution receipt before drawing a conclusion. A proposed plan and an observed operation are different kinds of evidence.

  7. Grounded conclusion

    Return an answer tied to the available sources and observed results. Saving a reusable method is an explicit, optional step after useful work, not automatic learning from every read.

Review an operation

“Prepare a change that requires approval.”

The cycle reaches the approval boundary, holds there and starts again. It does not imply that approval is automatic. Select a module to inspect its responsibility.

  1. Project scope

    Resolve the actor, project and permitted resources before choosing a capability. A useful result from another project does not grant access to it.

  2. Tool discovery

    Find a relevant capability, then load its exact argument schema. The working context receives what this request needs, not every tool declaration.

  3. Execution boundary

    Validate the actor, scope and exact operation before credentials are used. Where approval is required, bind it to that specific action rather than granting blanket access. An operation requiring approval stops here. Execution needs a separate authorization; this loop returns to the beginning.

  4. Provider operation

    Dispatch the permitted operation through its provider adapter. Reads, writes and uncertain outcomes retain their own handling; a timed-out write is not blindly repeated.

  5. Execution evidence

    Inspect the result and its execution receipt before drawing a conclusion. A proposed plan and an observed operation are different kinds of evidence.

  6. Grounded conclusion

    Return an answer tied to the available sources and observed results. Saving a reusable method is an explicit, optional step after useful work, not automatic learning from every read.

After completion, an agent may submit intent, applicability, a conditional plan and limitations. Observed receipts stay separate. A later task may retrieve this advice, but must resolve its own scope and permissions again.

What that means in practice

Architecture & decisions

01

Find an operation, then load its schema

Tool discovery returns compact matches with argument hints, risk information and a schema reference checked at invocation. The agent requests the exact schema for a selected operation, then invokes it by name. This keeps the full integration catalog outside the prompt while preserving a direct path from intent to the current tool contract.

02

Local embeddings and hybrid retrieval

Project knowledge combines FTS5 with local SentenceTransformer embeddings. A streamed vector scan retains the best fragment IDs before loading their content, and content hashes avoid embedding unchanged text. Reusable methods have a separate retrieval path: semantic and lexical selection followed by an optional local CrossEncoder that assesses relevance to the task.

03

Project scope and evidence of execution

A cross-system investigation starts with the permitted projects, resources and operations. Database records, logs and communication can then be examined within that scope. Calls requiring approval wait for a human decision. Execution receipts tie observed results to the current run, while the audit trail records actions and supports checking the final conclusion.

04

Methods that retain context and feedback

An agent can save the goal, applicability, conditional call plan and lessons from unsuccessful attempts. Later tasks retrieve a small set of methods to use, adapt or ignore. Reported usefulness and evidenced success remain separate signals. Learning accumulates and refines reusable experience; unchanged reuse keeps the existing method and its embedding.

05

Shared control for delegated work

The built-in agent runner uses a shared controller for token usage, model calls, tool attempts, workers and concurrency across delegated work. Deadlines and cancellation apply to the run tree, while operation claims track overlapping requests. This gives orchestration a common execution budget and explicit ownership as agents divide a task.

06

Automations with persistent runs

Cron, interval and event triggers start a tool operation or a multi-step agent workflow. Run state is stored in SQLite; workers claim work with an owner and lease, and expired leases can be recovered. Approval waits are explicit states. Recurring checks of project activity and communication use the same governed integration layer.

07

Keep results available and context compact

Results are retained encrypted and reopened through handles within their owner, expiry and policy boundaries. Knowledge fragments can be read selectively; memory packs cap items and characters. Method previews link to larger plans, while small plans keep their conditions inline. The agent can revisit details without copying every raw response into the conversation.

04 / Tools & technologies

Tools & technologies

Explore all skills (54)
Continue exploring

Amazon Data / Trends

Contact / Kraków, Poland

A role or a project? Let’s talk.

Hiring for your team or looking for help with a product? Tell me about the role or the problem. A name, contact and short outline are enough to start.

The portfolio, inside TelegramBrowse projects and send an offer in the Mini App. Open the bot, then choose the app.Open the bot

Start a conversation

A role, a product, or a technical challenge. Share a little context.

To use the form, enable JavaScript. You can also write to me directly on Telegram.

Write on Telegram