A lightweight agentic AI framework with MCP tool serving
Project description
Agentic AI MCP
Lightweight agentic AI with MCP tools. Supports distributed setups where tools run on one machine and agents on another.
Install
pip install agentic-ai-mcp
Setup
Set your Anthropic API key in .env file (only needed on the client/agent machine):
ANTHROPIC_API_KEY=sk-...
Quick Start
See the example notebooks:
examples/quickstart_server.ipynb- Run on machine exposing toolsexamples/quickstart_client.ipynb- Run on machine executing agents
Usage
Server Mode (expose tools)
Run this on the machine where you want to host tools:
from agentic_ai_mcp import AgenticAI
def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b
def greet(name: str, times: int = 1) -> str:
"""Greet someone."""
return ("Hello, " + name + "! ") * times
# Create and register tools
ai = AgenticAI(host="0.0.0.0", port=8888)
ai.register_tool(add)
ai.register_tool(greet)
# Start server
ai.run_mcp_server()
# Stop when done
ai.stop_mcp_server()
Client Mode (run agents)
Run this on another machine to connect to the server and execute agents:
from agentic_ai_mcp import AgenticAI
# Connect to remote MCP server
ai = AgenticAI(mcp_url="http://<server-ip>:8888/mcp")
# Simple agent workflow
result = await ai.run("Calculate 2+3 and greet Tom the result times")
print(result)
# Planning-based workflow for complex tasks
result = await ai.run_with_planning("First calculate ((1+2)+(1+1)+3), then greet Alice that many times")
print(result)
Methods
| Method | Description |
|---|---|
ai.register_tool(func) |
Register a function as an MCP tool |
ai.run_mcp_server() |
Start MCP server in background |
ai.stop_mcp_server() |
Stop the MCP server |
ai.run(prompt) |
Simple agent workflow |
ai.run_with_planning(prompt) |
Complex agent workflow |
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentic_ai_mcp-0.5.1.tar.gz.
File metadata
- Download URL: agentic_ai_mcp-0.5.1.tar.gz
- Upload date:
- Size: 11.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4652acf63ecc6c574e7104838f196ce6eaaf1c2e77e65195ab00bb4c2c05d9c2
|
|
| MD5 |
00f0b500178199f67eaf02a46d744cf9
|
|
| BLAKE2b-256 |
6dbe21fc9528fc506ab0adcff3630bef5fd6abc28c5d1562c5015fcfb662e3a5
|
Provenance
The following attestation bundles were made for agentic_ai_mcp-0.5.1.tar.gz:
Publisher:
cd.yml on hasanjawad001/agentic-ai-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_ai_mcp-0.5.1.tar.gz -
Subject digest:
4652acf63ecc6c574e7104838f196ce6eaaf1c2e77e65195ab00bb4c2c05d9c2 - Sigstore transparency entry: 997285897
- Sigstore integration time:
-
Permalink:
hasanjawad001/agentic-ai-mcp@01420f48dbc8c7e705e7e3665b4d81cad5625b3e -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/hasanjawad001
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@01420f48dbc8c7e705e7e3665b4d81cad5625b3e -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentic_ai_mcp-0.5.1-py3-none-any.whl.
File metadata
- Download URL: agentic_ai_mcp-0.5.1-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
53fa63e221d365bf6361c108ab10ce07b93e0a6b669b08d9af50849da523ec7b
|
|
| MD5 |
b3a7aa138b59600641f0be392f7e9f29
|
|
| BLAKE2b-256 |
4444899a512d184f6c11d5ad006d56dca99f9703cc8480c742ecbbadfaa7c21d
|
Provenance
The following attestation bundles were made for agentic_ai_mcp-0.5.1-py3-none-any.whl:
Publisher:
cd.yml on hasanjawad001/agentic-ai-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentic_ai_mcp-0.5.1-py3-none-any.whl -
Subject digest:
53fa63e221d365bf6361c108ab10ce07b93e0a6b669b08d9af50849da523ec7b - Sigstore transparency entry: 997285911
- Sigstore integration time:
-
Permalink:
hasanjawad001/agentic-ai-mcp@01420f48dbc8c7e705e7e3665b4d81cad5625b3e -
Branch / Tag:
refs/tags/v0.5.1 - Owner: https://github.com/hasanjawad001
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@01420f48dbc8c7e705e7e3665b4d81cad5625b3e -
Trigger Event:
release
-
Statement type: