Skip to content

Commit db0beeb

Browse files
authored
Add CONTRIBUTING.md (#1125)
1 parent 0897ca1 commit db0beeb

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed

CONTRIBUTING.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Contributing to MCP C# SDK
2+
3+
Thank you for your interest in contributing to the Model Context Protocol (MCP) C# SDK! This document provides guidelines and instructions for contributing to the project.
4+
5+
One of the easiest ways to contribute is to participate in discussions on GitHub issues. You can also contribute by submitting pull requests with code changes.
6+
7+
Also see the [overall MCP communication guidelines in our docs](https://modelcontextprotocol.io/community/communication), which explains how and where discussions about changes happen.
8+
9+
## Code of Conduct
10+
11+
This project follows the [Contributor Covenant Code of Conduct](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
12+
13+
## Bugs and feature requests
14+
15+
> [!IMPORTANT]
16+
> **If you want to report a security-related issue, please see the [Reporting security issues](SECURITY.md#reporting-security-issues) section of SECURITY.md.**
17+
18+
Before reporting a new issue, try to find an existing issue if one already exists. If it already exists, upvote (👍) it. Also, consider adding a comment with your unique scenarios and requirements related to that issue. Upvotes and clear details on the issue's impact help us prioritize the most important issues to be worked on sooner rather than later. If you can't find one, that's okay, we'd rather get a duplicate report than none.
19+
20+
If you can't find an existing issue, please [open a new issue on GitHub](https://github.com/modelcontextprotocol/csharp-sdk/issues).
21+
22+
## Prerequisites
23+
24+
Before you begin, ensure you have the following installed:
25+
26+
- **.NET SDK 10.0 or later** - Required to build and test the project
27+
- Download from [dotnet.microsoft.com/download](https://dotnet.microsoft.com/download)
28+
- Verify installation: `dotnet --version`
29+
30+
The dev container configuration in this repository includes all the necessary tools and SDKs to get started quickly.
31+
32+
## Building the Project
33+
34+
From the root directory of the repository, run:
35+
36+
```bash
37+
dotnet build
38+
```
39+
40+
This builds all projects in the solution with warnings treated as errors.
41+
42+
## Running Tests
43+
44+
### Run All Tests
45+
46+
From the root directory, run:
47+
48+
```bash
49+
dotnet test
50+
```
51+
52+
Some tests require Docker to be installed and running locally. If Docker is not available, those tests will be skipped.
53+
54+
Some tests require credentials for external services. When these are not available, those tests will be skipped.
55+
56+
Use the following environment variables to provide credentials for external services:
57+
58+
- AI:OpenAI:ApiKey - OpenAI API Key
59+
60+
### Run Tests for a Specific Project
61+
62+
```bash
63+
dotnet test tests/ModelContextProtocol.Tests/
64+
```
65+
66+
Tools like Visual Studio, JetBrains Rider, and VS Code also provide integrated test runners that can be used to run and debug individual tests.
67+
68+
### Building the Documentation
69+
70+
This project uses [DocFX](https://dotnet.github.io/docfx/) to generate its conceptual and reference documentation.
71+
72+
To view the documentation locally, run the following command from the root directory:
73+
74+
```bash
75+
make serve-docs
76+
```
77+
78+
Then open your browser and navigate to `http://localhost:8080`.
79+
80+
## Submitting Pull Requests
81+
82+
We are always happy to see PRs from community members both for bug fixes as well as new features.
83+
Here are a few simple rules to follow when you prepare to contribute to our codebase:
84+
85+
### Finding an issue to work on
86+
87+
Issues that are good candidates for first-time contributors are marked with the `good first issue` label.
88+
Those do not require too much familiarity with the framework and are more novice-friendly.
89+
90+
If you want to contribute a change that is not covered by an existing issue, first open an issue with a description of the change you would like to make and the problem it solves so it can be discussed before a pull request is submitted.
91+
92+
Assign yourself to the issue so others know you are working on it.
93+
94+
### Before writing code
95+
96+
For all but the smallest changes, it's a good idea to create a design document or at least a high-level description of your approach and share it in the issue for feedback before you start coding. This helps ensure that your approach aligns with the project's goals and avoids wasted effort.
97+
98+
### Before submitting the pull request
99+
100+
Before submitting a pull request, make sure that it checks the following requirements:
101+
102+
- The code follows the repository's style guidelines
103+
- Tests are included for new features or bug fixes
104+
- All existing and new tests pass locally
105+
- Appropriate error handling has been added
106+
- Documentation has been updated as needed
107+
108+
When submitting the pull request, provide a clear description of the changes made and reference the issue it addresses.
109+
110+
### During pull request review
111+
112+
A project maintainer will review your pull request and provide feedback.
113+
114+
## License
115+
116+
By contributing, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)