-
Notifications
You must be signed in to change notification settings - Fork 140
feat(mcp): add dapr mcp client + bump protos #997
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
Open
sicoyle
wants to merge
13
commits into
dapr:main
Choose a base branch
from
sicoyle:feat/mcp-crd
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8982869
feat(mcp): add mcp related classes + bump protos
sicoyle a54b80c
feat: add ex plus some changes
sicoyle a3a33ef
style: updates on workflow names
sicoyle 4bb5d94
chore: bump proto version
sicoyle a9ceed3
fix: update protos after merging latest with main
sicoyle 1c2fa75
style: uv run ruff format
sicoyle 029ca13
fix: bump protos again
sicoyle 9dc3565
fix: drop down proto versions
sicoyle 2dc31c1
Merge branch 'main' into feat/mcp-crd
sicoyle 316f09c
fix: address copilot feedback
sicoyle 8bb5794
Merge branch 'feat/mcp-crd' of github.com:sicoyle/python-sdk into fea…
sicoyle 607226f
style: appease linter
sicoyle 6de2af1
Merge branch 'main' into feat/mcp-crd
sicoyle File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -956,6 +956,7 @@ def __init__( | |||||
| registered_components: Sequence[RegisteredComponents], | ||||||
| extended_metadata: Dict[str, str], | ||||||
| headers: MetadataTuple = (), | ||||||
| mcp_servers: Optional[Sequence['MetadataMCPServer']] = None, | ||||||
| ): | ||||||
| """Initializes GetMetadataResponse. | ||||||
|
|
||||||
|
|
@@ -968,12 +969,15 @@ def __init__( | |||||
| extended_metadata (Dict[str, str]): mapping of custom (extended) | ||||||
| attributes to their respective values. | ||||||
| headers (Tuple, optional): the headers from Dapr gRPC response. | ||||||
| mcp_servers (Sequence[MetadataMCPServer], optional): list of | ||||||
| loaded MCPServer resources. | ||||||
| """ | ||||||
| super().__init__(headers) | ||||||
| self._application_id = application_id | ||||||
| self._active_actors_count = active_actors_count | ||||||
| self._registered_components = registered_components | ||||||
| self._extended_metadata = extended_metadata | ||||||
| self._mcp_servers = mcp_servers or [] | ||||||
|
|
||||||
| @property | ||||||
| def application_id(self) -> str: | ||||||
|
|
@@ -995,6 +999,11 @@ def extended_metadata(self) -> Dict[str, str]: | |||||
| """Mapping of custom (extended) attributes to their respective values.""" | ||||||
| return self._extended_metadata | ||||||
|
|
||||||
| @property | ||||||
| def mcp_servers(self) -> Sequence['MetadataMCPServer']: | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| """List of loaded MCPServer resources.""" | ||||||
| return self._mcp_servers | ||||||
|
|
||||||
|
|
||||||
| class RegisteredComponents(NamedTuple): | ||||||
| """Describes a loaded Dapr component.""" | ||||||
|
|
@@ -1012,6 +1021,13 @@ class RegisteredComponents(NamedTuple): | |||||
| """Supported capabilities for this component type and version.""" | ||||||
|
|
||||||
|
|
||||||
| class MetadataMCPServer(NamedTuple): | ||||||
| """Describes a loaded Dapr MCPServer resource.""" | ||||||
|
|
||||||
| name: str | ||||||
| """Name of the MCPServer resource.""" | ||||||
|
|
||||||
|
|
||||||
| class CryptoResponse(DaprResponse, Generic[TCryptoResponse]): | ||||||
| """An iterable of cryptography API responses.""" | ||||||
|
|
||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,10 +25,10 @@ import builtins as _builtins | |
| import sys | ||
| import typing as _typing | ||
|
|
||
| if sys.version_info >= (3, 10): | ||
| from typing import TypeAlias as _TypeAlias | ||
| if sys.version_info >= (3, 11): | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you use a newer version to generate the protos? |
||
| from typing import TypeAlias as _TypeAlias, Never as _Never | ||
| else: | ||
| from typing_extensions import TypeAlias as _TypeAlias | ||
| from typing_extensions import TypeAlias as _TypeAlias, Never as _Never | ||
|
|
||
| DESCRIPTOR: _descriptor.FileDescriptor | ||
|
|
||
|
|
@@ -91,8 +91,11 @@ class HTTPExtension(_message.Message): | |
| verb: Global___HTTPExtension.Verb.ValueType = ..., | ||
| querystring: _builtins.str = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["querystring", b"querystring", "verb", b"verb"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___HTTPExtension: _TypeAlias = HTTPExtension # noqa: Y015 | ||
|
|
||
|
|
@@ -143,6 +146,7 @@ class InvokeRequest(_message.Message): | |
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["content_type", b"content_type", "data", b"data", "http_extension", b"http_extension", "method", b"method"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___InvokeRequest: _TypeAlias = InvokeRequest # noqa: Y015 | ||
|
|
||
|
|
@@ -174,6 +178,7 @@ class InvokeResponse(_message.Message): | |
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["content_type", b"content_type", "data", b"data"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___InvokeResponse: _TypeAlias = InvokeResponse # noqa: Y015 | ||
|
|
||
|
|
@@ -201,8 +206,11 @@ class StreamPayload(_message.Message): | |
| data: _builtins.bytes = ..., | ||
| seq: _builtins.int = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["data", b"data", "seq", b"seq"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___StreamPayload: _TypeAlias = StreamPayload # noqa: Y015 | ||
|
|
||
|
|
@@ -226,8 +234,11 @@ class StateItem(_message.Message): | |
| key: _builtins.str = ..., | ||
| value: _builtins.str = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| KEY_FIELD_NUMBER: _builtins.int | ||
| VALUE_FIELD_NUMBER: _builtins.int | ||
|
|
@@ -265,6 +276,7 @@ class StateItem(_message.Message): | |
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["etag", b"etag", "key", b"key", "metadata", b"metadata", "options", b"options", "value", b"value"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___StateItem: _TypeAlias = StateItem # noqa: Y015 | ||
|
|
||
|
|
@@ -282,8 +294,11 @@ class Etag(_message.Message): | |
| *, | ||
| value: _builtins.str = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["value", b"value"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___Etag: _TypeAlias = Etag # noqa: Y015 | ||
|
|
||
|
|
@@ -337,8 +352,11 @@ class StateOptions(_message.Message): | |
| concurrency: Global___StateOptions.StateConcurrency.ValueType = ..., | ||
| consistency: Global___StateOptions.StateConsistency.ValueType = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["concurrency", b"concurrency", "consistency", b"consistency"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___StateOptions: _TypeAlias = StateOptions # noqa: Y015 | ||
|
|
||
|
|
@@ -362,8 +380,11 @@ class ConfigurationItem(_message.Message): | |
| key: _builtins.str = ..., | ||
| value: _builtins.str = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["key", b"key", "value", b"value"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| VALUE_FIELD_NUMBER: _builtins.int | ||
| VERSION_FIELD_NUMBER: _builtins.int | ||
|
|
@@ -383,8 +404,11 @@ class ConfigurationItem(_message.Message): | |
| version: _builtins.str = ..., | ||
| metadata: _abc.Mapping[_builtins.str, _builtins.str] | None = ..., | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _typing.Literal["metadata", b"metadata", "value", b"value", "version", b"version"] # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___ConfigurationItem: _TypeAlias = ConfigurationItem # noqa: Y015 | ||
|
|
||
|
|
@@ -425,6 +449,11 @@ class JobFailurePolicyDrop(_message.Message): | |
| def __init__( | ||
| self, | ||
| ) -> None: ... | ||
| _HasFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def HasField(self, field_name: _HasFieldArgType) -> _builtins.bool: ... | ||
| _ClearFieldArgType: _TypeAlias = _Never # noqa: Y015 | ||
| def ClearField(self, field_name: _ClearFieldArgType) -> None: ... | ||
| def WhichOneof(self, oneof_group: _Never) -> None: ... | ||
|
|
||
| Global___JobFailurePolicyDrop: _TypeAlias = JobFailurePolicyDrop # noqa: Y015 | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.