Skip to content

mcp: memory example #50

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MegaGrindStone
Copy link
Contributor

Motivation and Context

Part of #33 . This PR adds an example of implementing mcp on memory server.

How Has This Been Tested?

Breaking Changes

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@MegaGrindStone
Copy link
Contributor Author

One thing I just realized when implementing this is that the StructuredContent isn't marshalled into CallToolResult, which surprised me. Then, when I looks around, I think it's related to #20, isn't it? Or, do I miss something? If that is the case, then for now, I marshall the result into json string to be added as text content of CallToolResult.

@jba
Copy link
Contributor

jba commented Jun 26, 2025

That should be fixed by #46. Can you confirm?

@jba
Copy link
Contributor

jba commented Jun 26, 2025

I think this should live in the servers repo. See modelcontextprotocol/servers#2220.

@jba
Copy link
Contributor

jba commented Jun 26, 2025

We can keep working on it here until we figure out the story with that.

@MegaGrindStone
Copy link
Contributor Author

That should be fixed by #46. Can you confirm?

I'm sorry if I wasn't being clear, but the example is already working by marshalling the result into JSON string, and the external client could read the result as expected.

But, what was bothering me is, like being said in #20, if we pass the result struct directly (without marshalling into JSON) into StructuredContent, the result is not delivered to the client.

@MegaGrindStone
Copy link
Contributor Author

I think this should live in the servers repo. See modelcontextprotocol/servers#2220.

That would be great! And I think, this example (and the sequential thinking server #51) is more suited on that servers folder/repo than in the examples, as both doesn't show the usage of the mcp client implementation. Then, when we know where to put the servers repo, I could rewrite the examples to utilize the memory server, as a server and client implementation.

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