silsila (mcp-agent)
An agent framework built on MCP and Temporal for distributed AI applications
Introduction
This framework aims to make it straightforward to orchestrate complex AI workflows that rely on MCP (Model Context Protocol) servers for:
- Tools: Model-controlled functions like reading documents, calling APIs, or performing custom logic.
- Prompts: Templated interactions or question prompts exposed by servers.
- Memory: Persistent or semi-persistent data accessible through an MCP-compliant memory server.
- LLM Completions: Interfacing with large language models for planning or generating text.
We leverage Temporal to provide durable execution, parallelization, and the ability to pause or resume workflows. The code includes a developer-friendly dev mode for local iteration and a production path using Temporal for large-scale, resilient deployments.
Key Principles
-
MCP-First
All memory, prompts, tools, and even workflows are accessed via MCP calls. This ensures consistent usage patterns and the ability to switch underlying servers without changing workflow logic. -
Agents as Aggregators
Each Agent encapsulates multiple MCP servers and exposes typed methods for LLM completions, memory operations, and tool invocations. You never call raw MCP tools by name—instead, you invoke higher-level agent methods. Multiple agents can collaborate in a single workflow (e.g., one “planner” agent, one “worker” agent). -
Planner and Patterns
A Planner class handles LLM-driven decision-making (planning next actions). It returns structured directives (e.g., “Use tool X,” “Request human input,” “Done”). Common workflow patterns—like a “swarm” approach that repeatedly calls the planner—are encapsulated in base workflow classes such as SwarmWorkflowBase. -
Temporal Integration
By defining an OrchestratorInterface, the same workflows can run in dev mode (synchronously in your local environment) or production mode (as Temporal workflows). Human-in-the-loop signals and progress notifications are readily handled in both modes. -
Notifications and Human Input
Workflows can send progress or message notifications back to the upstream MCP client withnotifications/progressornotifications/message. They can also pause to wait for human input, which the user provides through an MCP tool call liketools/call(provide_human_input). -
Developer-Focused
The code aims to be readable and extensible, providing a straightforward mental model of how MCP orchestrations can be organized, tested, and extended for real-world AI pipelines.
High-Level Architecture
-
Agents (
MCPAggregator)- Wrap multiple MCP servers.
- Provide typed methods (e.g.,
agent.llm.complete_text()oragent.memory.get()).
-
Planner
- Uses an LLM-based approach to decide the next action.
- Returns a structured
Directivethat might say “use tool”, “request human input,” or “done.”
-
OrchestratorInterface
- Abstracts away the difference between dev (local) orchestration and production (Temporal) orchestration.
- Methods like
run_workflow(),send_message(),send_progress(), andwait_for_human_input()unify these environments.
-
Base Workflow Classes
- E.g.,
SwarmWorkflowBaseimplements a loop calling the Planner repeatedly, following the returned directives. - Developers can subclass to introduce domain-specific logic.
- E.g.,
-
MCP Server
- Optionally, this framework can itself be exposed as an MCP server, allowing upstream clients to call
tools/call(run_workflow)to start a workflow. - Human input is gathered by the upstream client calling
tools/call(provide_human_input)on the orchestrator server.
- Optionally, this framework can itself be exposed as an MCP server, allowing upstream clients to call
Metadata
Release files for silsila 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| silsila-0.0.1.tar.gz | 82.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| silsila-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 100.4 kB
Release files / silsila-0.0.1.tar.gz
| Download URL | silsila-0.0.1.tar.gz |
|---|---|
| Size | 82.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
abef11ba276963766ac32a1c57b289b29164ca79ef44c5aebd71c55091e6b5d6
|
|
BLAKE2b-256 checksum How to use checksums |
1bb72f61546a3b1fcff473043f8f1ae90a8c7871ab09e2652a59b2bbb91c2d13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.11
|
Release files / silsila-0.0.1-py3-none-any.whl
| Download URL | silsila-0.0.1-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c9cd64671d7e14503e20d5a23ecf06ac7add28db1c9bd16a4389732354b446d
|
|
BLAKE2b-256 checksum How to use checksums |
5facfa56f03fa51f1ff0ab66382678ce8209b81ed1a7b20c14a0ab9443aac701
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.5.11
|
Security for silsila 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.