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
OpenAI Agents SDK specific tools and services for AI agent development. Provides sample implementations and utilities for integrating MCP (Model Context Protocol) servers with OpenAI-based agents.
6
+
OpenAI Agents SDK specific tools and services for AI agent development. Provides MCP (Model Context Protocol) tool registration service for dynamically adding MCP servers to OpenAI Agents SDK-based agents.
This package provides sample implementations and patterns for OpenAI agent integration. Refer to the included sample files for implementation examples:
16
+
### Basic MCP Tool Registration
17
17
18
-
-`mcp_demo.py`: Complete working demonstration
19
-
-`sample_agent.py`: Basic agent with MCP management
20
-
-`advanced_tool_service.py`: Advanced service with multiple server types
21
-
-`tool_service_interface.py`: Interface definitions and patterns
18
+
```python
19
+
from microsoft_agents_a365.tooling.extensions.openai import (
20
+
McpToolRegistrationService
21
+
)
22
+
from agents import Agent
22
23
23
-
### Basic Pattern
24
+
# Initialize the tool registration service
25
+
mcp_service = McpToolRegistrationService()
24
26
25
-
```python
26
-
from openai import OpenAI
27
+
# Create your OpenAI agent
28
+
agent = Agent(
29
+
name="my-agent",
30
+
instructions="You are a helpful assistant"
31
+
)
27
32
28
-
# Initialize OpenAI client
29
-
client = OpenAI(api_key="your-api-key")
33
+
# Add MCP tool servers to agent
34
+
await mcp_service.add_tool_servers_to_agent(
35
+
agent=agent,
36
+
agentic_app_id="your-agent-id",
37
+
environment_id="your-environment-id",
38
+
auth=authorization,
39
+
context=turn_context
40
+
)
30
41
31
-
# Use MCP tool discovery patterns from samples
32
-
# See package samples for complete implementation examples
42
+
# Use the agent with registered MCP tools
43
+
response =await agent.run("Help me with my task")
33
44
```
34
45
35
46
## Support
@@ -44,121 +55,3 @@ For issues, questions, or feedback:
44
55
Copyright (c) Microsoft Corporation. All rights reserved.
45
56
46
57
Licensed under the MIT License - see the [LICENSE](../../../LICENSE.md) file for details.
0 commit comments