A lightweight agentic AI framework with MCP tool serving
Project description
Agentic AI MCP
Lightweight agentic AI with MCP tools. Supports multiple LLM providers (Anthropic, OpenAI) and distributed setups where tools run on one machine and agents on another.
Install
pip install agentic-ai-mcp
Setup
Set your API key in .env file (only needed on the client/agent machine):
# For Anthropic (default)
ANTHROPIC_API_KEY=sk-ant-...
# For OpenAI
OPENAI_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 (expose tools)
Run this on the machine where you want to host tools:
from agentic_ai_mcp import AgenticAIServer
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 server and register tools
server = AgenticAIServer(host="0.0.0.0", port=8888)
server.register_tool(add)
server.register_tool(greet)
print(f"Tools: {server.tools}")
print(f"URL: {server.mcp_url}")
# Start server in background
server.start()
# ... do other things ...
# Stop when done
server.stop()
Client (run agents)
Run this on another machine to connect to the server and execute agents:
from agentic_ai_mcp import AgenticAIClient
# Connect to MCP server
client = AgenticAIClient(mcp_url="http://<server-ip>:8888/mcp")
# Simple agent workflow
result = await client.run("Calculate 2+1, then greet 'Alice' that many times.")
print(result)
# Planning-based workflow for complex tasks
result = await client.run_with_planning("Calculate ((0+2) + (1+1) + 1), then greet 'Bob' that many times.")
print(result)
Using OpenAI
from agentic_ai_mcp import AgenticAIClient
# Use OpenAI instead of Anthropic
client = AgenticAIClient(
mcp_url="http://<server-ip>:8888/mcp",
provider="openai",
model="gpt-4o-mini"
)
result = await client.run("Calculate -1+2")
Passing API Key Directly
from agentic_ai_mcp import AgenticAIClient
# Pass API key directly (instead of using .env)
client = AgenticAIClient(
mcp_url="http://<server-ip>:8888/mcp",
api_key="sk-ant-..."
)
API Reference
AgenticAIServer
| Property/Method | Description |
|---|---|
server.tools |
List of registered tool names |
server.mcp_url |
Server URL |
server.is_running |
Check if server is running |
server.register_tool(func) |
Register a function as an MCP tool |
server.start() |
Start MCP server in background |
server.stop() |
Stop MCP server |
AgenticAIClient
| Property/Method | Description |
|---|---|
client.tools |
List of loaded tool names |
client.run(prompt) |
Simple agentic workflow |
client.run_with_planning(prompt) |
Planning-based workflow for complex tasks |
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.6.2.tar.gz.
File metadata
- Download URL: agentic_ai_mcp-0.6.2.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bdcc7a0d6414e389041b338ccfb4f2f054589943ca0b72a55e3c0c76b4be504e
|
|
| MD5 |
f332ab5d1f14706a1ccd41d1732885da
|
|
| BLAKE2b-256 |
b616f77745156c4500dbea018c6fed1f8ad86ad06e9394bb50461e369b004705
|
Provenance
The following attestation bundles were made for agentic_ai_mcp-0.6.2.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.6.2.tar.gz -
Subject digest:
bdcc7a0d6414e389041b338ccfb4f2f054589943ca0b72a55e3c0c76b4be504e - Sigstore transparency entry: 1010379645
- Sigstore integration time:
-
Permalink:
hasanjawad001/agentic-ai-mcp@3352105d821822d6a819affd5f74c46dd8639460 -
Branch / Tag:
refs/tags/v0.6.2 - Owner: https://github.com/hasanjawad001
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@3352105d821822d6a819affd5f74c46dd8639460 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentic_ai_mcp-0.6.2-py3-none-any.whl.
File metadata
- Download URL: agentic_ai_mcp-0.6.2-py3-none-any.whl
- Upload date:
- Size: 20.4 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 |
2f6868146268bbcbb91851b078a0e3482dc71c9e1bc9e97db518edad3e14e08a
|
|
| MD5 |
82fb3f9d51fa20b2e0b9ea2f9434b466
|
|
| BLAKE2b-256 |
b9720d38db7ffc6a73ffcf5a617298d3e0d4b416aac960447c1a2375a25b68ec
|
Provenance
The following attestation bundles were made for agentic_ai_mcp-0.6.2-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.6.2-py3-none-any.whl -
Subject digest:
2f6868146268bbcbb91851b078a0e3482dc71c9e1bc9e97db518edad3e14e08a - Sigstore transparency entry: 1010379688
- Sigstore integration time:
-
Permalink:
hasanjawad001/agentic-ai-mcp@3352105d821822d6a819affd5f74c46dd8639460 -
Branch / Tag:
refs/tags/v0.6.2 - Owner: https://github.com/hasanjawad001
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@3352105d821822d6a819affd5f74c46dd8639460 -
Trigger Event:
release
-
Statement type: