You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"allowed_communication_protocols": ["http"], // Optional, defaults to [call_template_type]. Restricts which protocols tools can use.
380
381
"auth": { // Optional, authentication for the HTTP request (example using ApiKeyAuth for Bearer token)
381
382
"auth_type": "api_key",
382
383
"api_key": "Bearer $API_KEY", // Required
@@ -514,6 +515,81 @@ Note the name change from `http_stream` to `streamable_http`.
514
515
}
515
516
```
516
517
518
+
## Security: Protocol Restrictions
519
+
520
+
UTCP provides fine-grained control over which communication protocols each manual can use through the `allowed_communication_protocols` field. This prevents potentially dangerous protocol escalation (e.g., an HTTP-based manual accidentally calling CLI tools).
521
+
522
+
### Default Behavior (Secure by Default)
523
+
524
+
When `allowed_communication_protocols` is not set or is empty, a manual can only register and call tools that use the **same protocol type** as the manual itself:
525
+
526
+
```python
527
+
from utcp_http.http_call_template import HttpCallTemplate
528
+
529
+
# This manual can ONLY register/call HTTP tools (default restriction)
530
+
http_manual = HttpCallTemplate(
531
+
name="my_api",
532
+
call_template_type="http",
533
+
url="https://api.example.com/utcp"
534
+
# allowed_communication_protocols not set → defaults to ["http"]
535
+
)
536
+
```
537
+
538
+
### Allowing Multiple Protocols
539
+
540
+
To allow a manual to work with tools from multiple protocols, explicitly set `allowed_communication_protocols`:
541
+
542
+
```python
543
+
from utcp_http.http_call_template import HttpCallTemplate
544
+
545
+
# This manual can register/call both HTTP and CLI tools
546
+
multi_protocol_manual = HttpCallTemplate(
547
+
name="flexible_manual",
548
+
call_template_type="http",
549
+
url="https://api.example.com/utcp",
550
+
allowed_communication_protocols=["http", "cli"] # Explicitly allow both
"auth_tools": { // Optional, authentication for converted tools, if this call template points to an openapi spec that should be automatically converted to a utcp manual (applied only to endpoints requiring auth per OpenAPI spec)
"auth_tools": { // Optional, authentication for generated tools from OpenAPI specs
486
+
"auth_type": "api_key",
487
+
"api_key": "Bearer ${API_TOKEN}",
488
+
"var_name": "Authorization",
489
+
"location": "header"
490
+
}
474
491
}
475
492
```
476
493
@@ -498,6 +515,81 @@ Note the name change from `http_stream` to `streamable_http`.
498
515
}
499
516
```
500
517
518
+
## Security: Protocol Restrictions
519
+
520
+
UTCP provides fine-grained control over which communication protocols each manual can use through the `allowed_communication_protocols` field. This prevents potentially dangerous protocol escalation (e.g., an HTTP-based manual accidentally calling CLI tools).
521
+
522
+
### Default Behavior (Secure by Default)
523
+
524
+
When `allowed_communication_protocols` is not set or is empty, a manual can only register and call tools that use the **same protocol type** as the manual itself:
525
+
526
+
```python
527
+
from utcp_http.http_call_template import HttpCallTemplate
528
+
529
+
# This manual can ONLY register/call HTTP tools (default restriction)
530
+
http_manual = HttpCallTemplate(
531
+
name="my_api",
532
+
call_template_type="http",
533
+
url="https://api.example.com/utcp"
534
+
# allowed_communication_protocols not set → defaults to ["http"]
535
+
)
536
+
```
537
+
538
+
### Allowing Multiple Protocols
539
+
540
+
To allow a manual to work with tools from multiple protocols, explicitly set `allowed_communication_protocols`:
541
+
542
+
```python
543
+
from utcp_http.http_call_template import HttpCallTemplate
544
+
545
+
# This manual can register/call both HTTP and CLI tools
546
+
multi_protocol_manual = HttpCallTemplate(
547
+
name="flexible_manual",
548
+
call_template_type="http",
549
+
url="https://api.example.com/utcp",
550
+
allowed_communication_protocols=["http", "cli"] # Explicitly allow both
The testing structure has been updated to reflect the new core/plugin split.
@@ -535,4 +627,68 @@ The build process now involves building each package (`core` and `plugins`) sepa
535
627
4. Run the build: `python -m build`.
536
628
5. The distributable files (`.whl` and `.tar.gz`) will be in the `dist/` directory.
537
629
630
+
## OpenAPI Ingestion - Zero Infrastructure Tool Integration
631
+
632
+
🚀 **Transform any existing REST API into UTCP tools without server modifications!**
633
+
634
+
UTCP's OpenAPI ingestion feature automatically converts OpenAPI 2.0/3.0 specifications into UTCP tools, enabling AI agents to interact with existing APIs directly - no wrapper servers, no API changes, no additional infrastructure required.
635
+
636
+
### Quick Start with OpenAPI
637
+
638
+
```python
639
+
from utcp_http.openapi_converter import OpenApiConverter
640
+
import aiohttp
641
+
642
+
# Convert any OpenAPI spec to UTCP tools
643
+
asyncdefconvert_api():
644
+
asyncwith aiohttp.ClientSession() as session:
645
+
asyncwith session.get("https://api.github.com/openapi.json") as response:
646
+
openapi_spec =await response.json()
647
+
648
+
converter = OpenApiConverter(openapi_spec)
649
+
manual = converter.convert()
650
+
651
+
print(f"Generated {len(manual.tools)} tools from GitHub API!")
652
+
return manual
653
+
654
+
# Or use UTCP Client configuration for automatic detection
655
+
from utcp.utcp_client import UtcpClient
656
+
657
+
client =await UtcpClient.create(config={
658
+
"manual_call_templates": [{
659
+
"name": "github",
660
+
"call_template_type": "http",
661
+
"url": "https://api.github.com/openapi.json",
662
+
"auth_tools": { # Authentication for generated tools requiring auth
663
+
"auth_type": "api_key",
664
+
"api_key": "Bearer ${GITHUB_TOKEN}",
665
+
"var_name": "Authorization",
666
+
"location": "header"
667
+
}
668
+
}]
669
+
})
670
+
```
671
+
672
+
### Key Benefits
673
+
674
+
- ✅ **Zero Infrastructure**: No servers to deploy or maintain
675
+
- ✅ **Direct API Calls**: Native performance, no proxy overhead
0 commit comments