|
1 | | -# Build with Aspire |
| 1 | +# Aspiring .NET with OpenAI and Ollama |
2 | 2 |
|
3 | | -This repository contains resources and examples demonstrating building with .NET Aspire, including a complete implementation of the Model Context Protocol (MCP) for AI agent tools. |
| 3 | +A talk on building AI-powered, cloud-native applications with .NET Aspire, OpenAI, and Ollama, including an MCP server and Microsoft Agent Framework integration. |
4 | 4 |
|
5 | 5 | ## Slides |
6 | 6 |
|
7 | | -The slides for the related talk can be found at:\ |
8 | | -[http://chris-ayers.com/build-with-aspire/](http://chris-ayers.com/build-with-aspire/) |
9 | | - |
10 | | -## Repository Content |
11 | | - |
12 | | -This repository provides insights, best practices, and demonstrations for building with Aspire. Topics covered include: |
13 | | - |
14 | | -- An introduction to Aspire. |
15 | | -- Features and benefits of using Aspire. |
16 | | -- Step-by-step guide to start a new project with Aspire. |
17 | | -- Advanced scenarios like optimizing performance and scalability. |
18 | | -- Publishing Aspire applications to various platforms. |
19 | | -- Passing configuration and secrets to Aspire applications. |
20 | | -- **MCP Server Implementation**: Complete implementation using the official MCP C# SDK with dynamic tool discovery over HTTPS/SSE |
21 | | - |
22 | | -## Project Features |
23 | | - |
24 | | -### MCP Server Integration |
25 | | - |
26 | | -This project demonstrates a production-ready implementation of the Model Context Protocol (MCP): |
27 | | - |
28 | | -- **Official MCP C# SDK**: Uses [modelcontextprotocol/csharp-sdk](https://github.com/modelcontextprotocol/csharp-sdk) |
29 | | -- **Dynamic Tool Discovery**: API service discovers tools from MCP server at runtime |
30 | | -- **HTTPS/SSE Transport**: Server-Sent Events for bidirectional communication |
31 | | -- **Service Discovery**: Aspire handles endpoint resolution between services |
32 | | -- **13 Built-in Tools**: Weather, System, and Math tools ready to use |
33 | | -- **Microsoft Agent Framework**: Integrated with AI agent for autonomous tool usage |
34 | | - |
35 | | -### Architecture |
36 | | - |
37 | | -``` |
38 | | -API Service → (HTTPS/SSE) → MCP Server → Tools |
39 | | - ↓ ↓ |
40 | | -Chat Agent WeatherTools |
41 | | -(Microsoft Agent Framework) SystemTools |
42 | | - MathTools |
43 | | -``` |
44 | | - |
45 | | -### Documentation |
46 | | - |
47 | | -- **[api-tests/](./api-tests/)**: HTTP test files for all endpoints |
48 | | -- **[MCP Server README](./src/BuildWithAspire.MCPServer/README.md)**: MCP Server implementation details |
49 | | - |
50 | | -## Getting Started |
51 | | - |
52 | | -### Prerequisites |
53 | | - |
54 | | -- .NET 9.0 SDK or later |
55 | | -- Docker Desktop (for Aspire) |
56 | | -- Visual Studio Code or Visual Studio 2022 |
57 | | - |
58 | | -### Quick Start |
59 | | - |
60 | | -```bash |
61 | | -# Clone the repository |
62 | | -git clone https://github.com/codebytes/build-with-aspire.git |
63 | | -cd build-with-aspire |
64 | | - |
65 | | -# Run with .NET CLI |
66 | | -cd src/BuildWithAspire.AppHost |
67 | | -dotnet run |
68 | | - |
69 | | -# Or press F5 in VS Code / Visual Studio |
70 | | -``` |
71 | | - |
72 | | -The Aspire Dashboard will open at `https://localhost:17020` showing all services. |
73 | | - |
74 | | -### Service Endpoints |
75 | | - |
76 | | -- **MCP Server**: http://localhost:8080 |
77 | | -- **API Service**: http://localhost:5020 |
78 | | -- **Aspire Dashboard**: https://localhost:17020 |
79 | | - |
80 | | -### Testing the MCP Server |
81 | | - |
82 | | -```bash |
83 | | -# List available tools |
84 | | -curl http://localhost:5020/mcp/tools |
85 | | - |
86 | | -# Check service health |
87 | | -curl http://localhost:8080/health |
88 | | -curl http://localhost:5020/health |
89 | | -``` |
90 | | - |
91 | | -Use the [api-tests/](./api-tests/) directory for more HTTP test examples. |
| 7 | +[View HTML slides](https://chris-ayers.com/build-with-aspire/) | [Download PDF](https://chris-ayers.com/build-with-aspire/Slides.pdf) |
92 | 8 |
|
93 | 9 | ## Resources |
94 | 10 |
|
| 11 | +- [Slide source](slides/Slides.md) |
| 12 | +- [Demo and setup guide](docs/demo-guide.md) |
| 13 | +- [API test examples](api-tests/) |
| 14 | +- [MCP server documentation](src/BuildWithAspire.MCPServer/README.md) |
95 | 15 | - [.NET Aspire](https://learn.microsoft.com/en-us/dotnet/aspire/get-started/aspire-overview) |
| 16 | +- [Aspire Samples](https://github.com/dotnet/aspire-samples) |
96 | 17 | - [MCP Specification](https://modelcontextprotocol.io/) |
97 | 18 | - [MCP C# SDK](https://github.com/modelcontextprotocol/csharp-sdk) |
98 | 19 | - [Microsoft Agent Framework](https://github.com/microsoft/agent-framework) |
99 | | -- [Aspirify](https://aspireify.net/) |
100 | | -- [Aspire Samples](https://github.com/dotnet/aspire-samples) |
101 | | - |
102 | | -## Connect with Chris Ayers |
103 | 20 |
|
104 | | -Feel free to connect with Chris Ayers on social media and visit his blog for more information on Playwright and other topics: |
| 21 | +## Contact |
105 | 22 |
|
106 | | -- Twitter: [@Chris_L_Ayers](https://twitter.com/Chris_L_Ayers) |
107 | | -- Mastodon: [@Chrisayers@hachyderm.io](https://hachyderm.io/@Chrisayers) |
108 | | -- LinkedIn: [chris-l-ayers](https://linkedin.com/in/chris-l-ayers/) |
109 | | -- Blog: [https://chris-ayers.com/](https://chris-ayers.com/) |
110 | | -- GitHub: [Codebytes](https://github.com/codebytes) |
| 23 | +**Chris Ayers**, Principal Software Engineer |
111 | 24 |
|
112 | | -## License |
| 25 | +[Blog](https://chris-ayers.com/) | [GitHub](https://github.com/codebytes) | [LinkedIn](https://linkedin.com/in/chris-l-ayers/) | [Bluesky](https://bsky.app/profile/chris-ayers.com) | [Mastodon](https://hachyderm.io/@Chrisayers) |
113 | 26 |
|
114 | | -This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information. |
| 27 | +Licensed under the [MIT License](LICENSE). |
0 commit comments