Skip to content
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

Add [McpServerPrompt] support #126

Merged
merged 1 commit into from
Mar 31, 2025

Conversation

stephentoub
Copy link
Contributor

Ignore the first commit; that's just #124, which this builds on top of.

I also still need to add tests. I could also use some help on a better word than "Items" when talking about the group of things that is tools, prompts, resources, etc.

This adds support for declaratively and programmatically created prompts, e.g. an [McpServerPrompt] attribute to tag functions that should be used as prompts, a set of McpServerPrompt.Create for programmatically created prompt instances, etc.

Closes #70

@stephentoub stephentoub force-pushed the mcpserverprompt branch 2 times, most recently from 6eaa071 to 9f03dcc Compare March 28, 2025 17:55
@stephentoub stephentoub marked this pull request as ready for review March 28, 2025 17:56
@stephentoub
Copy link
Contributor Author

This is ready for review.

@PederHP
Copy link
Collaborator

PederHP commented Mar 28, 2025

Maybe add WeatherPrompts to the server QuickStart? With example prompts for exercising each tool? This shows both the Prompt feature and helps guide users to using the server correctly (no need to figure out the correct prompt to make the model call the tool).

@stephentoub stephentoub mentioned this pull request Mar 30, 2025
9 tasks
@stephentoub stephentoub force-pushed the mcpserverprompt branch 3 times, most recently from caa949a to d8142fb Compare March 31, 2025 02:50
aaronpowell added a commit to aaronpowell/modelcontextprotocol-csharp-sdk that referenced this pull request Mar 31, 2025
It's not the best handler, but modelcontextprotocol#126 will make this easier
@stephentoub stephentoub merged commit 5d3fb65 into modelcontextprotocol:main Mar 31, 2025
8 checks passed
@stephentoub stephentoub deleted the mcpserverprompt branch March 31, 2025 13:54
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.

Include PromptType and Prompt attributes
4 participants