Skip to main content

Examples

Agent Codemode includes three example categories that demonstrate different aspects of the framework.

1. Simple Examples​

Basic interactive CLI examples demonstrating MCP server integration with standard and codemode modes.

Location: examples/simple/

ExampleDescription
agent_cli.pyInteractive CLI agent with MCP stdio server
example_mcp_server.pyMinimal MCP server with file tools
cd examples/simple

# Standard MCP mode
make agent

# Codemode (code-first tool composition)
make agent-codemode

Tools provided:

  • generate_random_text(word_count, seed)
  • write_text_file(path, content)
  • read_text_file(path, include_content, max_chars)
  • read_text_file_many(path, times, include_content, max_chars)

2. Patterns Examples​

Examples demonstrating codemode patterns for progressive discovery and code execution.

Location: examples/patterns/

ExampleDescription
codemode_example.pyProgressive discovery and code execution
codemode_patterns_example.pyOverview of all codemode patterns
cd examples/patterns

# Run codemode example
make codemode-example

# Run patterns overview
make codemode-patterns

3. Skills Examples​

Demonstrates codemode with agent-skills integration. Uses the skills from the skills/ folder for document processing capabilities.

Location: examples/skills/

ExampleDescription
agent_cli.pySkills-enabled agent CLI (codemode by default)
example_mcp_server.pyMCP server with file tools
cd examples/skills

# Run with skills (codemode is the default)
make agent

# Explicitly run in standard MCP mode
make agent-standard

Available Skills:

The skills/ folder contains skill definitions that the agent can discover and use:

SkillDescription
pdfPDF manipulation toolkit - extract text/tables, merge/split documents, fill forms

Example prompts:

> What skills do you have available?
> Extract text from document.pdf
> Fill out the form in application.pdf with my details

For more on skills, see the agent-skills repository.