-
Notifications
You must be signed in to change notification settings - Fork 742
fix(mcp): Added support for newer version of MCP #2956
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
Conversation
Signed-off-by: fali007 <felixpv007@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Changes requested ❌
Reviewed everything up to ff941cd in 1 minute and 38 seconds. Click for details.
- Reviewed
38
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
0
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_ZMCsAewgwXEb6l8F
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
packages/opentelemetry-instrumentation-mcp/opentelemetry/instrumentation/mcp/instrumentation.py
Outdated
Show resolved
Hide resolved
packages/opentelemetry-instrumentation-mcp/opentelemetry/instrumentation/mcp/instrumentation.py
Outdated
Show resolved
Hide resolved
…umentation/mcp/instrumentation.py Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
…umentation/mcp/instrumentation.py Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Can you please use this decorator: https://github.com/traceloop/openllmetry/blob/1648905598915776956ef46a077c8fb941094662/packages/opentelemetry-semantic-conventions-ai/opentelemetry/semconv_ai/utils.py In the instrumentation methods? So if there will be failures in the instrumentation it won't crash the user's app. |
Made the change @galkleinman |
💪 tests are failing now tho :X |
Signed-off-by: fali007 <felixpv007@gmail.com>
async def __aiter__(self) -> AsyncGenerator[Any, None]: | ||
from mcp.types import JSONRPCMessage, JSONRPCRequest | ||
from mcp.shared.message import SessionMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the 1.6.0 version of MCP doesn't have a message module within the mcp.shared module. This will result in a ModuleNotFoundError: No module named 'mcp.shared.message', causing the instrumentation of MCP 1.6.0 to fail. Could you please fix this to make it compatible with mcp version 1.6.0?
feat(instrumentation): ...
orfix(instrumentation): ...
.This PR intends to add support for MCP version >1.6.0
Important
Adds support for MCP version >1.6.0 by updating
InstrumentedStreamReader
andInstrumentedStreamWriter
to handleSessionMessage
andJSONRPCMessage
.instrumentation.py
.__aiter__()
inInstrumentedStreamReader
to handleSessionMessage
andJSONRPCMessage
.send()
inInstrumentedStreamWriter
to handleSessionMessage
andJSONRPCMessage
.from mcp.shared.message import SessionMessage
ininstrumentation.py
.This description was created by
for ff941cd. You can customize this summary. It will automatically update as commits are pushed.