{"id":36761844,"url":"https://github.com/plantoncloud/graphton","last_synced_at":"2026-01-12T12:56:06.943Z","repository":{"id":326414133,"uuid":"1105449476","full_name":"plantoncloud/graphton","owner":"plantoncloud","description":"Declarative agent creation framework for LangGraph - eliminate boilerplate, build agents in minutes","archived":false,"fork":false,"pushed_at":"2025-12-16T00:06:19.000Z","size":694,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-19T08:46:19.527Z","etag":null,"topics":["ai-agents","framework","langchain","langgraph","mcp","python"],"latest_commit_sha":null,"homepage":"https://github.com/plantoncloud-inc/graphton","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/plantoncloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-27T16:14:45.000Z","updated_at":"2025-12-16T00:03:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/plantoncloud/graphton","commit_stats":null,"previous_names":["plantoncloud-inc/graphton","plantoncloud/graphton"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/plantoncloud/graphton","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plantoncloud%2Fgraphton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plantoncloud%2Fgraphton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plantoncloud%2Fgraphton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plantoncloud%2Fgraphton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/plantoncloud","download_url":"https://codeload.github.com/plantoncloud/graphton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/plantoncloud%2Fgraphton/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338990,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-agents","framework","langchain","langgraph","mcp","python"],"created_at":"2026-01-12T12:56:06.889Z","updated_at":"2026-01-12T12:56:06.938Z","avatar_url":"https://github.com/plantoncloud.png","language":"Python","readme":"# Graphton\n\n[![CI](https://github.com/plantoncloud/graphton/actions/workflows/ci.yml/badge.svg)](https://github.com/plantoncloud/graphton/actions/workflows/ci.yml)\n[![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**Declarative agent creation framework for LangGraph**\n\nGraphton eliminates boilerplate when creating LangGraph agents with MCP tools. Create production-ready agents in **3-10 lines instead of 100+**.\n\n## Features\n\n- **Declarative Agent Creation**: Minimal boilerplate - just specify model and behavior\n- **Automatic Prompt Enhancement**: Agents automatically understand available capabilities (planning, file system, MCP tools)\n- **Universal MCP Authentication**: Support for any MCP server configuration with both static and dynamic authentication modes\n- **Intelligent Loop Detection**: Automatically detects and prevents infinite loops in autonomous agents\n- **Production Ready**: Works in both local and remote LangGraph deployments\n- **Type-Safe Configuration**: Pydantic validation with helpful error messages\n- **IDE Support**: Full autocomplete and type hints for better developer experience\n\n## Quick Start\n\n### Installation\n\n```bash\npip install graphton\n```\n\n### Simple Agent\n\nCreate a basic agent in just 3 lines:\n\n```python\nfrom graphton import create_deep_agent\n\nSYSTEM_PROMPT = \"\"\"You are a helpful assistant that answers questions concisely.\nWhen answering questions:\n- Be direct and to the point\n- Provide accurate information\n- If you're not sure, say so\n\"\"\"\n\n# Create agent with just model and prompt\nagent = create_deep_agent(\n    model=\"claude-sonnet-4.5\",\n    system_prompt=SYSTEM_PROMPT,\n)\n\n# Invoke the agent\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"What is the capital of France?\"}]\n})\n```\n\n### Agent with MCP Tools\n\nIntegrate MCP tools with dynamic per-user authentication:\n\n```python\nfrom graphton import create_deep_agent\nimport os\n\n# Agent with dynamic MCP authentication\nagent = create_deep_agent(\n    model=\"claude-sonnet-4.5\",\n    system_prompt=\"You are a Planton Cloud assistant helping users manage cloud resources.\",\n    \n    # MCP integration with template variables\n    mcp_servers={\n        \"planton-cloud\": {\n            \"transport\": \"streamable_http\",\n            \"url\": \"https://mcp.planton.ai/\",\n            \"headers\": {\n                \"Authorization\": \"Bearer {{USER_TOKEN}}\"  # Substituted at runtime\n            }\n        }\n    },\n    mcp_tools={\n        \"planton-cloud\": [\n            \"list_organizations\",\n            \"search_cloud_resources\",\n            \"create_cloud_resource\",\n        ]\n    },\n    \n    # Optional parameters\n    recursion_limit=150,\n    temperature=0.3,\n)\n\n# Invoke with user-specific token\nresult = agent.invoke(\n    {\"messages\": [{\"role\": \"user\", \"content\": \"List my organizations\"}]},\n    config={\n        \"configurable\": {\n            \"USER_TOKEN\": os.getenv(\"PLANTON_API_KEY\")\n        }\n    }\n)\n```\n\n### Static MCP Configuration\n\nFor shared credentials, use static configuration (tools loaded once at creation time):\n\n```python\nagent = create_deep_agent(\n    model=\"claude-sonnet-4.5\",\n    system_prompt=\"You are an API assistant.\",\n    \n    mcp_servers={\n        \"public-api\": {\n            \"transport\": \"http\",\n            \"url\": \"https://api.example.com/mcp\",\n            \"headers\": {\n                \"X-API-Key\": \"hardcoded-key-123\"  # No templates = static\n            }\n        }\n    },\n    mcp_tools={\n        \"public-api\": [\"search\", \"fetch\"]\n    }\n)\n\n# Invoke without auth config - credentials already in config\nresult = agent.invoke(\n    {\"messages\": [{\"role\": \"user\", \"content\": \"Search for Python\"}]}\n)\n```\n\n### Agent with Sub-agents\n\nDelegate complex tasks to specialized sub-agents with isolated context:\n\n```python\nfrom graphton import create_deep_agent\n\nagent = create_deep_agent(\n    model=\"claude-sonnet-4.5\",\n    system_prompt=\"You are a research coordinator that delegates specialized tasks.\",\n    \n    # Define specialized sub-agents\n    subagents=[\n        {\n            \"name\": \"deep-researcher\",\n            \"description\": \"Conducts thorough research on complex topics with comprehensive analysis\",\n            \"system_prompt\": \"You are a research specialist. Conduct thorough research, cite sources, and provide comprehensive analysis.\",\n        },\n        {\n            \"name\": \"code-reviewer\",\n            \"description\": \"Reviews code for quality, security, and best practices\",\n            \"system_prompt\": \"You are a code review expert. Analyze code for bugs, security issues, and improvement opportunities.\",\n        }\n    ],\n    \n    # Include general-purpose sub-agent for other tasks\n    general_purpose_agent=True,\n)\n\n# The agent can now delegate tasks to sub-agents\nresult = agent.invoke({\n    \"messages\": [{\"role\": \"user\", \"content\": \"Research quantum computing and review the attached code\"}]\n})\n```\n\n**When to use sub-agents:**\n- Complex multi-step tasks that can be delegated\n- Independent parallel tasks  \n- Tasks requiring focused reasoning without context bloat\n- Specialized domains (research, code review, data analysis)\n\n**Benefits:**\n- **Context isolation**: Each sub-agent has its own context window\n- **Token efficiency**: Main agent gets concise summaries, not full task history\n- **Parallel execution**: Launch multiple sub-agents simultaneously\n- **Specialization**: Different sub-agents with domain-specific tools\n\n## Automatic Prompt Enhancement\n\nGraphton automatically enhances your instructions with awareness of Deep Agents capabilities. This ensures agents understand what tools they have and when to use them.\n\n### What Gets Enhanced\n\nWhen you provide simple instructions like:\n\n```python\nagent = create_deep_agent(\n    model=\"claude-sonnet-4.5\",\n    system_prompt=\"You are a helpful research assistant.\",\n)\n```\n\nGraphton automatically adds context about:\n- **Planning System**: For breaking down complex multi-step tasks\n- **File System**: For storing and managing information across operations\n- **MCP Tools**: When configured, awareness of domain-specific capabilities\n\n### Why This Matters\n\nDeep Agents come with powerful built-in tools (planning, file system, subagents), but agents won't use them effectively unless they know they exist. Graphton bridges this gap by automatically informing agents about available capabilities.\n\n### Control and Flexibility\n\n- **Automatic by default**: Enhancement happens automatically for all agents\n- **Redundancy is fine**: If your instructions already mention planning or file system, some overlap will occur. This is intentional - LLMs handle redundancy gracefully, and reinforcement is better than missing critical context\n- **Can be disabled**: Use `auto_enhance_prompt=False` to pass instructions as-is\n\n```python\n# Disable enhancement if you've already included all context\nagent = create_deep_agent(\n    model=\"claude-sonnet-4.5\",\n    system_prompt=\"Detailed instructions with all tool context...\",\n    auto_enhance_prompt=False,  # Use prompt as-is\n)\n```\n\n## Documentation\n\n- **[Configuration Guide](docs/CONFIGURATION.md)** - Complete reference for all configuration options\n- **[API Documentation](docs/API.md)** - Full API reference\n- **[Examples](examples/)** - More usage examples including:\n  - `simple_agent.py` - Basic agent without MCP\n  - `mcp_agent.py` - Dynamic MCP authentication\n  - `static_mcp_agent.py` - Static MCP configuration\n  - `multi_auth_agent.py` - Multiple servers with mixed authentication\n\n## Universal MCP Authentication\n\nGraphton supports any MCP server configuration format and authentication method through template-based token injection:\n\n**Dynamic Mode** (with `{{VAR}}` templates):\n- Templates substituted from `config['configurable']` at invocation time\n- Tools loaded per-request with user-specific authentication\n- Use for multi-tenant systems or per-user tokens\n\n**Static Mode** (no template variables):\n- Tools loaded once at agent creation time\n- Zero runtime overhead\n- Use for hardcoded credentials or public servers\n\nSupported authentication methods:\n- Bearer tokens (OAuth, JWT)\n- API Keys\n- Basic Auth\n- Custom headers\n- Any authentication format supported by your MCP server\n\n## Requirements\n\n- Python 3.11 or higher\n- Poetry (for development)\n\n## License\n\nApache-2.0 - See [LICENSE](LICENSE) for details\n\n## Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.\n\n## Links\n\n- **Repository**: https://github.com/plantoncloud/graphton\n- **Documentation**: https://github.com/plantoncloud/graphton#readme\n- **Issues**: https://github.com/plantoncloud/graphton/issues\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplantoncloud%2Fgraphton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplantoncloud%2Fgraphton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplantoncloud%2Fgraphton/lists"}