Skip to main content

Micro agent with tool support and MCP integration.

Project description

z007 ⚡ Fast Micro Agent

A lightweight and readable agent for interacting with LLM on AWS Bedrock with tool and MCP (Model Context Protocol) support.

Features

  • Lightning Fast: Quick setup with uvx z007 with AWS_PROFILE=<your profile> env and start chatting instantly
  • Simple Install: Quick install uv tool install z007 and start chatting instantly z007 with AWS_PROFILE=<your profile> env
  • 🔧 Tool Support: Built-in calculator and custom tool integration
  • 🔌 MCP Integration: Connect to Model Context Protocol servers
  • 🐍 Python API: Easy integration into your Python projects
  • 🚀 Async: Fast, concurrent tool execution

Quick Start

Install and run with uvx (recommended)

# Install and run directly - fastest way to start!
uvx z007

# Or install globally  
uv tool install z007
z007

Install as Python package

pip install z007

Usage

Command Line

# Start interactive chat
z007

# With custom model (AWS Bedrock)
z007 --model-id "anthropic.claude-3-sonnet-20240229-v1:0"

# With MCP configuration
z007 --mcp-config .vscode/mcp.json

Python API

Simple usage

import asyncio
from z007 import Agent

async def main():
    async with Agent(model_id="openai.gpt-oss-20b-1:0") as agent:
        response = await agent.run("What is 2+2?")
    print(response)

asyncio.run(main())

With tools

import asyncio
from z007 import Agent, create_calculator_tool

async def main():
    calculator = create_calculator_tool()
    async with Agent(
        model_id="openai.gpt-oss-20b-1:0",
        tools=[calculator]
    ) as agent:
        response = await agent.run("Calculate 15 * 23 + 7")
    print(response)

asyncio.run(main())

Using the Agent class

import asyncio
from z007 import Agent

async def main():
    async with Agent(
        model_id="openai.gpt-oss-20b-1:0",
        system_prompt="You are a helpful coding assistant."
    ) as agent:
        response = await agent.run("Write a Python function to reverse a string")
        print(response)

asyncio.run(main())

Custom Tools

Create your own tools by writing simple Python functions:

import asyncio
from z007 import Agent

def weather_tool(city: str) -> str:
    """Get weather information for a city"""
    # In a real implementation, call a weather API
    return f"The weather in {city} is sunny, 25°C"

def file_reader_tool(filename: str) -> str:
    """Read contents of a file"""
    try:
        with open(filename, 'r') as f:
            return f.read()
    except Exception as e:
        return f"Error reading file: {e}"

async def main():
    async with Agent(
        model_id="openai.gpt-oss-20b-1:0",
        tools=[weather_tool, file_reader_tool]
    ) as agent:
        response = await agent.run("What's the weather like in Paris?")
    print(response)

asyncio.run(main())

MCP Integration

Connect to Model Context Protocol servers for advanced capabilities:

  1. Create .vscode/mcp.json:
{
  "servers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"]
    },
    "brave-search": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-brave-search"],
      "env": {
        "BRAVE_API_KEY": "${env:BRAVE_API_KEY}"
      }
    }
  }
}
  1. Use with z007:
z007 --mcp-config .vscode/mcp.json

Or in Python:

from z007 import Agent

async with Agent(
    model_id="openai.gpt-oss-20b-1:0",
    mcp_config_path=".vscode/mcp.json"
) as agent:
    response = await agent.run("Search for recent news about AI")
    print(response)

Configuration

Environment Variables

For AWS Bedrock (default provider):

  • AWS_PROFILE: AWS profile name or
  • AWS_REGION: AWS region (default: us-east-1)
  • AWS_ACCESS_KEY_ID: AWS access key
  • AWS_SECRET_ACCESS_KEY: AWS secret key

Supported Models

Current AWS Bedrock models:

  • openai.gpt-oss-20b-1:0 (default)
  • Any AWS Bedrock model with tool support

Interactive Commands

When running z007 in interactive mode:

  • /help - Show help
  • /tools - List available tools
  • /clear - Clear conversation history
  • /exit - Exit

Requirements

  • Python 3.9+
  • LLM provider credentials (AWS for Bedrock)

License

MIT License


z007 ⚡ Fast, lightweight, powerful. Get things done quickly! 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

z007-0.1.2.tar.gz (57.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

z007-0.1.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file z007-0.1.2.tar.gz.

File metadata

  • Download URL: z007-0.1.2.tar.gz
  • Upload date:
  • Size: 57.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for z007-0.1.2.tar.gz
Algorithm Hash digest
SHA256 80f4ad92b0b89a6691c90c8e9abbdbd68a2d3fc04a513d90222d090f6308c83a
MD5 204f015124d5aa8080e9626f56bb9b50
BLAKE2b-256 5824bddf0ee4b4f484463ec5e0b638dbf07141e4469a6dbab8f7bbfbcdf04edc

See more details on using hashes here.

File details

Details for the file z007-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: z007-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for z007-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0c3ac13ceab1fb5699ba1d2048d9d4847b53d0ffeeee2a0a6219d3b8f467a6ed
MD5 09e3a6a9f66316bed806df654c1d624f
BLAKE2b-256 a747db26da294a231151aac93a05e64354c1cb74cc7b429c1f405fe5c8037577

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page