Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Added mcp 'instructions' attribute to the server #706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 18, 2025

Conversation

DanieleMorotti
Copy link
Contributor

Added the instructions attribute to the MCP servers to solve #704 .

Let me know if you want to add an example to the documentation.

@@ -122,7 +123,8 @@ async def connect(self):
else None,
)
)
await session.initialize()
server_result = await session.initialize()
self.instructions = getattr(server_result, "instructions", None)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use getattr? I see initialize() returns types.InitializeResult, which has instructions: str | None = None

In fact, we should probably just set self.server_initialize_result. That way devs can read other info too, e.g. protocol version or capabilities

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you prefer, the issue was about instructions so I read that value, but now I set the variable as you suggested.

Copy link
Collaborator

@rm-openai rm-openai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awesome thank you

@rm-openai rm-openai merged commit 003cbfe into openai:main May 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.