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/
| Example | Description |
|---|---|
agent_cli.py | Interactive CLI agent with MCP stdio server |
example_mcp_server.py | Minimal 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/
| Example | Description |
|---|---|
codemode_example.py | Progressive discovery and code execution |
codemode_patterns_example.py | Overview 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/
| Example | Description |
|---|---|
agent_cli.py | Skills-enabled agent CLI (codemode by default) |
example_mcp_server.py | MCP 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:
| Skill | Description |
|---|---|
pdf | PDF 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.