Skip to content

docs: simplify counter example #122

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

rikhuijzer
Copy link
Contributor

I thought _create_resource_text was part of the public API, but noticed that it's only used inside this file. To make that more clear, I moved the function definition closer to the callsite.

Motivation and Context

It makes the example a bit clearer.

How Has This Been Tested?

I manually ran the examples.

Breaking Changes

No

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

@rikhuijzer rikhuijzer force-pushed the rh/simplify-counter-example branch from 54f21f6 to bc7d00f Compare April 10, 2025 12:09
@rikhuijzer rikhuijzer force-pushed the rh/simplify-counter-example branch from bc7d00f to a9c1918 Compare April 10, 2025 12:10
@@ -17,4 +17,4 @@ rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", features = [
"client",
"transport-child-process",
"transport-sse",
], no-default-features = true }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This had no effect like in #112. Setting default-features = false does not compile so I just removed it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry , I didn't meet this problem, could you pls provide more detail?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uhm yes I'll try. The setting no-default-features does not exists, so no-default-features = true is ignored by Cargo. The setting should be default-features = true, but if you set that the code does not compile. So that's why I removed it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The confusion might be because of cargo build --no-default-features. That is a valid option.

@rikhuijzer rikhuijzer closed this Apr 13, 2025
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