Feature/react call mcp (#428)

Key Features

  - MCP Tool Integration: Added core MCP tool support with ToolClientSpec and ToolClient classes
  - API Enhancement: New mcp_tool method for flow-specific tool invocation
  - CLI Tooling: New tg-invoke-mcp-tool command for testing MCP integration
  - React Agent Enhancement: Fixed and improved multi-tool invocation capabilities
  - Tool Management: Enhanced CLI for tool configuration and management

Changes

  - Added MCP tool invocation to API with flow-specific integration
  - Implemented ToolClientSpec and ToolClient for tool call handling
  - Updated agent-manager-react to invoke MCP tools with configurable types
  - Enhanced CLI with new commands and improved help text
  - Added comprehensive documentation for new CLI commands
  - Improved tool configuration management

Testing

  - Added tg-invoke-mcp-tool CLI command for isolated MCP integration testing
  - Enhanced agent capability to invoke multiple tools simultaneously
This commit is contained in:
cybermaggedon 2025-07-08 16:19:19 +01:00 committed by GitHub
parent e56186054a
commit 9c7a070681
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 2718 additions and 9 deletions

View file

@ -210,6 +210,51 @@ Request schema:
Response schema:
`trustgraph.schema.FlowResponse`
## Flow Service Methods
Flow instances provide access to various TrustGraph services through flow-specific endpoints:
### MCP Tool Service - Invoke MCP Tools
The `mcp_tool` method allows invoking MCP (Model Control Protocol) tools within a flow context.
Request:
```json
{
"name": "file-reader",
"parameters": {
"path": "/path/to/file.txt"
}
}
```
Response:
```json
{
"object": {"content": "file contents here", "size": 1024}
}
```
Or for text responses:
```json
{
"text": "plain text response"
}
```
### Other Service Methods
Flow instances also provide access to:
- `text_completion` - LLM text completion
- `agent` - Agent question answering
- `graph_rag` - Graph-based RAG queries
- `document_rag` - Document-based RAG queries
- `embeddings` - Text embeddings
- `prompt` - Prompt template processing
- `triples_query` - Knowledge graph queries
- `load_document` - Document loading
- `load_text` - Text loading
## Python SDK
The Python SDK provides convenient access to the Flow API:
@ -233,6 +278,10 @@ flows = await client.list_flows()
# Stop a flow instance
await client.stop_flow("flow-123")
# Use flow instance services
flow = client.id("flow-123")
result = await flow.mcp_tool("file-reader", {"path": "/path/to/file.txt"})
```
## Features