Skip to content

Commit 2972fd7

Browse files
Update documentation configuration (#86)
* Docs configuration * Update docs/index.md Co-authored-by: Eirik Tsarpalis <[email protected]> * Update the configuration * Update docs/docfx.json Co-authored-by: Eirik Tsarpalis <[email protected]> * Update config * Update icons, use Makefile, remove warnings * Use a link that passes markdown link validation * remove working directory --------- Co-authored-by: Eirik Tsarpalis <[email protected]>
1 parent 1f8ebee commit 2972fd7

File tree

9 files changed

+248
-0
lines changed

9 files changed

+248
-0
lines changed

.config/dotnet-tools.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"docfx": {
6+
"version": "2.78.3",
7+
"commands": [
8+
"docfx"
9+
],
10+
"rollForward": false
11+
}
12+
}
13+
}

.github/workflows/docs.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
on:
2+
release:
3+
types: [published]
4+
workflow_dispatch:
5+
6+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
7+
permissions:
8+
actions: read
9+
pages: write
10+
id-token: write
11+
12+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
13+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
14+
concurrency:
15+
group: "pages"
16+
cancel-in-progress: false
17+
18+
jobs:
19+
publish-docs:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v3
27+
28+
- name: .NET Setup
29+
uses: actions/setup-dotnet@v4
30+
with:
31+
dotnet-version: 9.x
32+
33+
- name: Generate documentation
34+
run: make generate-docs
35+
36+
- name: Upload Pages artifact
37+
uses: actions/upload-pages-artifact@v3
38+
with:
39+
path: 'artifacts/_site'
40+
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,7 @@ _NCrunch_*
7373
nCrunchTemp_*
7474

7575
*.orig
76+
77+
# Auto-generated documentation
78+
docs/_site
79+
docs/api

Makefile

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
SOURCE_DIRECTORY := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
2+
ARTIFACT_PATH := $(SOURCE_DIRECTORY)artifacts
3+
DOCS_PATH := $(SOURCE_DIRECTORY)docs
4+
CONFIGURATION ?= Release
5+
6+
clean:
7+
dotnet clean
8+
rm -rf $(ARTIFACT_PATH)/*
9+
rm -rf $(DOCS_PATH)/api
10+
11+
restore:
12+
dotnet tool restore
13+
dotnet restore
14+
15+
build: restore
16+
dotnet build --no-restore --configuration $(CONFIGURATION)
17+
18+
test: build
19+
dotnet test \
20+
--no-build \
21+
--configuration $(CONFIGURATION) \
22+
--filter '(Execution!=Manual)' \
23+
--blame \
24+
--diag "$(ARTIFACT_PATH)/diag.txt" \
25+
--logger "trx" \
26+
--collect "Code Coverage;Format=cobertura" \
27+
--results-directory $(ARTIFACT_PATH)/test-results \
28+
-- \
29+
RunConfiguration.CollectSourceInformation=true
30+
31+
generate-docs: clean restore
32+
dotnet build --no-restore --configuration Release
33+
dotnet docfx $(DOCS_PATH)/docfx.json
34+
35+
serve-docs: generate-docs
36+
dotnet docfx serve $(ARTIFACT_PATH)/_site --port 8080
37+
38+
.DEFAULT_GOAL := build

docs/docfx.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json",
3+
"metadata": [
4+
{
5+
"src": [
6+
{
7+
"src": "../src",
8+
"files": [
9+
"**/*.csproj"
10+
]
11+
}
12+
],
13+
"output": "api"
14+
}
15+
],
16+
"build": {
17+
"content": [
18+
{
19+
"files": [
20+
"**/*.{md,yml}"
21+
],
22+
"exclude": [
23+
"_site/**"
24+
]
25+
}
26+
],
27+
"resource": [
28+
{
29+
"files": [
30+
"images/**"
31+
]
32+
}
33+
],
34+
"output": "../artifacts/_site",
35+
"template": [
36+
"default",
37+
"modern"
38+
],
39+
"globalMetadata": {
40+
"_appName": "MCP C# SDK",
41+
"_appTitle": "MCP C# SDK",
42+
"_appLogoPath": "images/mcp.svg",
43+
"_appFaviconPath": "images/favicon.ico",
44+
"_enableSearch": true,
45+
"pdf": false
46+
}
47+
}
48+
}

docs/images/favicon.ico

32.5 KB
Binary file not shown.

docs/images/mcp.svg

+74
Loading

docs/index.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
_layout: landing
3+
---
4+
5+
# Overview
6+
7+
The official C# SDK for the [Model Context Protocol](https://modelcontextprotocol.io/), enabling .NET applications, services, and libraries to implement and interact with MCP clients and servers. Please visit our [API documentation](https://modelcontextprotocol.github.io/csharp-sdk/api/ModelContextProtocol.html) for more details on available functionality.
8+
9+
## About MCP
10+
11+
The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). It enables secure integration between LLMs and various data sources and tools.
12+
13+
For more information about MCP:
14+
15+
- [Official Documentation](https://modelcontextprotocol.io/)
16+
- [Protocol Specification](https://spec.modelcontextprotocol.io/)
17+
- [GitHub Organization](https://github.com/modelcontextprotocol)
18+
19+
For how-to guides, tutorials, and additional guidance, refer to the [official MCP documentation](https://modelcontextprotocol.io/).
20+
21+
## License
22+
23+
This project is licensed under the [MIT License](https://github.com/modelcontextprotocol/csharp-sdk/blob/main/LICENSE).

docs/toc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
items:
2+
- name: API Docs
3+
href: api/ModelContextProtocol.yml
4+
- name: Github
5+
href: https://github.com/ModelContextProtocol/csharp-sdk

0 commit comments

Comments
 (0)