Skip to content

Commit 7d82f3a

Browse files
committed
docs: add vitepress documentation setup
1 parent 5075f49 commit 7d82f3a

File tree

9 files changed

+1085
-20
lines changed

9 files changed

+1085
-20
lines changed

.changeset/dirty-jars-admire.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@mcp-kit/docs': patch
3+
---
4+
5+
docs: add vitepress documentation setup

docs/.vitepress/config.mts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: "My Awesome Project",
6+
description: "A VitePress Site",
7+
themeConfig: {
8+
// https://vitepress.dev/reference/default-theme-config
9+
nav: [
10+
{ text: 'Home', link: '/' },
11+
{ text: 'Examples', link: '/markdown-examples' }
12+
],
13+
14+
sidebar: [
15+
{
16+
text: 'Examples',
17+
items: [
18+
{ text: 'Markdown Examples', link: '/markdown-examples' },
19+
{ text: 'Runtime API Examples', link: '/api-examples' }
20+
]
21+
}
22+
],
23+
24+
socialLinks: [
25+
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
26+
]
27+
}
28+
})

docs/api-examples.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Runtime API Examples
6+
7+
This page demonstrates usage of some of the runtime APIs provided by VitePress.
8+
9+
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10+
11+
```md
12+
<script setup>
13+
import { useData } from 'vitepress'
14+
15+
const { theme, page, frontmatter } = useData()
16+
</script>
17+
18+
## Results
19+
20+
### Theme Data
21+
<pre>{{ theme }}</pre>
22+
23+
### Page Data
24+
<pre>{{ page }}</pre>
25+
26+
### Page Frontmatter
27+
<pre>{{ frontmatter }}</pre>
28+
```
29+
30+
<script setup>
31+
import { useData } from 'vitepress'
32+
33+
const { site, theme, page, frontmatter } = useData()
34+
</script>
35+
36+
## Results
37+
38+
### Theme Data
39+
<pre>{{ theme }}</pre>
40+
41+
### Page Data
42+
<pre>{{ page }}</pre>
43+
44+
### Page Frontmatter
45+
<pre>{{ frontmatter }}</pre>
46+
47+
## More
48+
49+
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).

docs/config.mts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { defineConfig } from 'vitepress'
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: 'MCP Kit',
6+
description: 'A CLI tool to create MCP (Model Context Protocol) applications with ease',
7+
base: '/mcp-kit/',
8+
head: [
9+
['link', { rel: 'shortcut icon', href: '/mcp-kit/favicons/favicon-64x64.png' }],
10+
['link', { rel: 'apple-touch-icon', sizes: '180x180', href: '/mcp-kit/favicons/apple-touch-icon.png' }],
11+
],
12+
themeConfig: {
13+
// https://vitepress.dev/reference/default-theme-config
14+
logo: '/logo.png',
15+
socialLinks: [
16+
{ icon: 'github', link: 'https://github.com/my-mcp-hub/mcp-kit' }
17+
],
18+
nav: [
19+
{ text: 'Home', link: '/' },
20+
{ text: 'Guide', link: '/guide/what-is-this', activeMatch: '/guide/' },
21+
{ text: 'Configs', link: '/config/', activeMatch: '/config/' },
22+
{ text: 'Examples', link: '/guide/examples', activeMatch: '/guide/examples' },
23+
{
24+
text: '0.0.6',
25+
items: [
26+
{
27+
text: 'Changelog',
28+
link: 'https://github.com/my-mcp-hub/mcp-kit/blob/main/packages/create-mcp-kit/CHANGELOG.md'
29+
},
30+
]
31+
}
32+
],
33+
34+
sidebar: [
35+
{
36+
text: 'Examples',
37+
items: [
38+
{ text: 'Markdown Examples', link: '/markdown-examples' },
39+
{ text: 'Runtime API Examples', link: '/api-examples' }
40+
]
41+
}
42+
],
43+
}
44+
})

docs/index.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
layout: home
3+
4+
hero:
5+
name: "MCP Kit"
6+
text: "Model Context Protocol Toolkit"
7+
tagline: A CLI tool to create MCP applications with ease
8+
actions:
9+
- theme: brand
10+
text: Get Started 👆
11+
link: /markdown-examples
12+
- theme: alt
13+
text: View on GitHub
14+
link: https://github.com/my-mcp-hub/mcp-kit
15+
16+
features:
17+
- title: Quick Scaffolding
18+
icon: 🚀
19+
details: Generate MCP server projects instantly with pre-configured TypeScript setup and development tools.
20+
- title: TypeScript First
21+
icon: 📦
22+
details: Built-in TypeScript support with full type safety, modern ES modules, and excellent developer experience.
23+
- title: Development Tools
24+
icon: 🛠️️
25+
details: Includes testing, linting, hot reload, and build tools to streamline your development workflow.
26+
- title: Configurable Templates
27+
icon: 🔧️
28+
details: Flexible project templates that can be customized to fit your specific use case and requirements.
29+
- title: Multiple Transport Modes
30+
icon: 🌐️
31+
details: Support for both STDIO and web server modes, allowing flexible deployment options.
32+
- title: Comprehensive APIs
33+
icon: 📚️
34+
details: Easy-to-use APIs for implementing tools, resources, and prompts following MCP specifications.
35+
---
36+

docs/markdown-examples.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Markdown Extension Examples
2+
3+
This page demonstrates some of the built-in markdown extensions provided by VitePress.
4+
5+
## Syntax Highlighting
6+
7+
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
8+
9+
**Input**
10+
11+
````md
12+
```js{4}
13+
export default {
14+
data () {
15+
return {
16+
msg: 'Highlighted!'
17+
}
18+
}
19+
}
20+
```
21+
````
22+
23+
**Output**
24+
25+
```js{4}
26+
export default {
27+
data () {
28+
return {
29+
msg: 'Highlighted!'
30+
}
31+
}
32+
}
33+
```
34+
35+
## Custom Containers
36+
37+
**Input**
38+
39+
```md
40+
::: info
41+
This is an info box.
42+
:::
43+
44+
::: tip
45+
This is a tip.
46+
:::
47+
48+
::: warning
49+
This is a warning.
50+
:::
51+
52+
::: danger
53+
This is a dangerous warning.
54+
:::
55+
56+
::: details
57+
This is a details block.
58+
:::
59+
```
60+
61+
**Output**
62+
63+
::: info
64+
This is an info box.
65+
:::
66+
67+
::: tip
68+
This is a tip.
69+
:::
70+
71+
::: warning
72+
This is a warning.
73+
:::
74+
75+
::: danger
76+
This is a dangerous warning.
77+
:::
78+
79+
::: details
80+
This is a details block.
81+
:::
82+
83+
## More
84+
85+
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).

docs/package.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"name": "@mcp-kit/docs",
3+
"version": "1.0.0",
4+
"private": true,
5+
"description": "mcp kit docs",
6+
"scripts": {
7+
"dev": "vitepress dev",
8+
"build": "vitepress build",
9+
"preview": "vitepress preview"
10+
},
11+
"keywords": [],
12+
"author": "zhensherlock",
13+
"license": "MIT",
14+
"dependencies": {
15+
},
16+
"devDependencies": {
17+
"vitepress": "^2.0.0-alpha.10"
18+
}
19+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"test": "cross-env NODE_V8_COVERAGE=./coverage/tmp vitest run",
1212
"coverage": "rimraf coverage && cross-env NODE_V8_COVERAGE=./coverage/tmp vitest run && npm run report",
1313
"report": "c8 report --reporter=lcov --reporter=html",
14+
"docs:dev": "pnpm -r --aggregate-output --filter=./docs dev",
15+
"docs:build": "pnpm -r --aggregate-output --filter=./docs build",
16+
"docs:serve": "pnpm -r --aggregate-output --filter=./docs serve",
1417
"changeset": "changeset",
1518
"version": "changeset version"
1619
},
@@ -55,7 +58,7 @@
5558
"prettier": "^3.6.2",
5659
"rimraf": "^6.0.1",
5760
"rolldown": "1.0.0-beta.27",
58-
"tsx": "^4.20.3",
61+
"tsx": "^4.20.4",
5962
"typescript": "^5.9.2",
6063
"vitest": "^3.2.4"
6164
}

0 commit comments

Comments
 (0)