Skip to content

Commit 065d8db

Browse files
committed
docs: restructure documentation for mcp kit
1 parent 88f537b commit 065d8db

File tree

10 files changed

+179
-291
lines changed

10 files changed

+179
-291
lines changed

docs/.vitepress/config.ts

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { defineConfig } from 'vitepress'
44
export default defineConfig({
55
title: 'MCP Kit',
66
description: 'A CLI tool to create MCP (Model Context Protocol) applications with ease',
7+
rewrites: {
8+
'en/:rest*': ':rest*',
9+
},
710
base: '/mcp-kit/',
811
head: [
912
['link', { rel: 'shortcut icon', href: '/mcp-kit/favicons/favicon.png' }],
@@ -17,11 +20,9 @@ export default defineConfig({
1720
],
1821
nav: [
1922
{ 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+
{ text: 'Guide', link: '/guide/what-is-mcp', activeMatch: '/guide/' },
2324
{
24-
text: '0.0.6',
25+
text: '0.0.7',
2526
items: [
2627
{
2728
text: 'Changelog',
@@ -37,16 +38,9 @@ export default defineConfig({
3738
items: [
3839
{ text: 'What is MCP?', link: '/guide/what-is-mcp' },
3940
{ text: 'What is MCP Kit?', link: '/guide/what-is-mcp-kit' },
40-
{ text: 'Getting Started', link: '/en/guide/getting-started' },
41-
]
41+
{ text: 'Getting Started', link: '/guide/getting-started' },
42+
],
4243
},
43-
{
44-
text: 'Examples',
45-
items: [
46-
{ text: 'Markdown Examples', link: '/markdown-examples' },
47-
{ text: 'Runtime API Examples', link: '/api-examples' }
48-
]
49-
}
5044
],
5145
}
5246
})

docs/api-examples.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

docs/en/guide/getting-started.md

Lines changed: 89 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -4,205 +4,161 @@ layout: doc
44

55
# Getting Started
66

7-
## Try It Online
8-
9-
You can try VitePress directly in your browser on [StackBlitz](https://vitepress.new).
10-
117
## Installation
128

139
### Prerequisites
1410

1511
- [Node.js](https://nodejs.org/) version 18 or higher.
16-
- Terminal for accessing VitePress via its command line interface (CLI).
17-
- Text Editor with [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax support.
18-
- [VSCode](https://code.visualstudio.com/) is recommended, along with the [official Vue extension](https://marketplace.visualstudio.com/items?itemName=Vue.volar).
12+
- Terminal for accessing MCP Kit via its command line interface (CLI).
1913

20-
VitePress can be used on its own, or be installed into an existing project. In both cases, you can install it with:
14+
MCP Kit can be used to create new MCP (Model Context Protocol) applications. You can install and use it with any of the following package managers:
2115

2216
::: code-group
23-
2417
```sh [npm]
25-
$ npm add -D vitepress@next
18+
$ npm create mcp-kit@latest
2619
```
2720

2821
```sh [pnpm]
29-
$ pnpm add -D vitepress@next
22+
$ pnpm create mcp-kit@latest
3023
```
3124

3225
```sh [yarn]
33-
$ yarn add -D vitepress@next vue
34-
```
35-
36-
```sh [bun]
37-
$ bun add -D vitepress@next
26+
$ yarn create mcp-kit@latest
3827
```
39-
4028
:::
4129

4230
::: tip NOTE
43-
44-
VitePress is an ESM-only package. Don't use `require()` to import it, and make sure your nearest `package.json` contains `"type": "module"`, or change the file extension of your relevant files like `.vitepress/config.js` to `.mjs`/`.mts`. Refer to [Vite's troubleshooting guide](http://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only) for more details. Also, inside async CJS contexts, you can use `await import('vitepress')` instead.
45-
31+
MCP Kit is an ESM-only package. It requires Node.js version 18 or higher and uses modern JavaScript features.
4632
:::
4733

48-
### Setup Wizard
34+
## Setup Wizard
4935

50-
VitePress ships with a command line setup wizard that will help you scaffold a basic project. After installation, start the wizard by running:
36+
When you run the create command, MCP Kit will launch an interactive setup wizard that guides you through creating a new project:
5137

52-
::: code-group
38+
<<< @/snippets/init.ansi
5339

54-
```sh [npm]
55-
$ npx vitepress init
56-
```
40+
1. First, you'll be prompted to select a **Project type**:
41+
- **MCP Server**: Creates a server that provides tools, resources, and prompts for MCP clients
42+
- **MCP Client**: Creates a client that connects to MCP servers
5743

58-
```sh [pnpm]
59-
$ pnpm vitepress init
60-
```
44+
2. Next, you'll be asked to provide a **Project name** (defaults to `mcp-[type]-starter`)
6145

62-
```sh [yarn]
63-
$ yarn vitepress init
64-
```
46+
3. Choose your preferred **Project language**:
47+
- **TypeScript** (recommended)
48+
- **JavaScript**
6549

66-
```sh [bun]
67-
$ bun vitepress init
68-
```
50+
4. Select **Project Transport Type** (multiple options can be selected):
51+
- **STDIO**: Communication through standard input/output streams
52+
- **Streamable HTTP**: RESTful API with streaming capabilities
53+
- **SSE**: Server-Sent Events for real-time communication
6954

70-
[//]: # (:::)
55+
5. Choose a **Project template**:
56+
- **Standard**: Includes recommended plugins and configurations
57+
- **Custom**: Allows you to select specific plugins
7158

72-
[//]: # ()
73-
[//]: # (You will be greeted with a few simple questions:)
59+
6. If you selected **Custom** template, you'll be prompted to select **Project plugins**:
60+
- **GitHub Action**: CI/CD workflows
61+
- **Vitest**: Testing framework
62+
- **Inspector**: Debugging tools (server projects only)
63+
- **ESLint + Prettier + Lint-staged**: Code quality tools
64+
- **Commitlint**: Commit message linting
65+
- **Changelog**: Automated changelog generation
7466

75-
[//]: # ()
76-
[//]: # (<<< @/snippets/init.ansi)
67+
7. Finally, you'll be asked if you want to **install dependencies** automatically
7768

78-
[//]: # ()
79-
[//]: # (::: tip Vue as Peer Dependency)
80-
81-
[//]: # (If you intend to perform customization that uses Vue components or APIs, you should also explicitly install `vue` as a dependency.)
82-
83-
[//]: # (:::)
69+
After completing these steps, MCP Kit will create your project with the selected configuration.
8470

8571
## File Structure
8672

87-
If you are building a standalone VitePress site, you can scaffold the site in your current directory (`./`). However, if you are installing VitePress in an existing project alongside other source code, it is recommended to scaffold the site in a nested directory (e.g. `./docs`) so that it is separate from the rest of the project.
73+
The generated file structure depends on the project type you selected.
8874

89-
Assuming you chose to scaffold the VitePress project in `./docs`, the generated file structure should look like this:
75+
### MCP Server Project Structure
9076

9177
```
92-
.
93-
├─ docs
94-
│ ├─ .vitepress
95-
│ │ └─ config.js
96-
│ ├─ api-examples.md
97-
│ ├─ markdown-examples.md
98-
│ └─ index.md
99-
└─ package.json
78+
├── src/
79+
│ ├── tools/ # MCP tools implementation
80+
│ │ ├── index.ts # Tools registration
81+
│ │ └── register*.ts # Individual tool implementations
82+
│ ├── resources/ # MCP resources implementation
83+
│ │ └── index.ts # Resources registration
84+
│ ├── prompts/ # MCP prompts implementation
85+
│ │ └── index.ts # Prompts registration
86+
│ ├── services/ # Server implementations
87+
│ │ ├── stdio.ts # STDIO transport implementation
88+
│ │ └── web.ts # Streamable HTTP and SSE transport implementation
89+
│ └── index.ts # Entry point
90+
├── tests/ # Test files
91+
├── scripts/ # Build and development scripts
92+
├── .github/ # GitHub Actions workflows (optional)
93+
├── .husky/ # Git hooks (optional)
94+
└── package.json
10095
```
10196

102-
The `docs` directory is considered the **project root** of the VitePress site. The `.vitepress` directory is a reserved location for VitePress' config file, dev server cache, build output, and optional theme customization code.
103-
104-
::: tip
105-
By default, VitePress stores its dev server cache in `.vitepress/cache`, and the production build output in `.vitepress/dist`. If using Git, you should add them to your `.gitignore` file. These locations can also be [configured](../reference/site-config#outdir).
106-
:::
107-
108-
### The Config File
109-
110-
The config file (`.vitepress/config.js`) allows you to customize various aspects of your VitePress site, with the most basic options being the title and description of the site:
111-
112-
```js [.vitepress/config.js]
113-
export default {
114-
// site-level options
115-
title: 'VitePress',
116-
description: 'Just playing around.',
97+
### MCP Client Project Structure
11798

118-
themeConfig: {
119-
// theme-level options
120-
}
121-
}
99+
```
100+
├── src/
101+
│ └── index.ts # Entry point with transport implementations
102+
├── tests/ # Test files
103+
├── scripts/ # Build and development scripts
104+
├── .github/ # GitHub Actions workflows (optional)
105+
├── .husky/ # Git hooks (optional)
106+
└── package.json
122107
```
123108

124-
You can also configure the behavior of the theme via the `themeConfig` option. Consult the [Config Reference](../reference/site-config) for full details on all config options.
125-
126-
### Source Files
127-
128-
Markdown files outside the `.vitepress` directory are considered **source files**.
129-
130-
VitePress uses **file-based routing**: each `.md` file is compiled into a corresponding `.html` file with the same path. For example, `index.md` will be compiled into `index.html`, and can be visited at the root path `/` of the resulting VitePress site.
131-
132-
VitePress also provides the ability to generate clean URLs, rewrite paths, and dynamically generate pages. These will be covered in the [Routing Guide](./routing).
109+
::: tip
110+
The project structure is designed to be modular and extensible. You can customize it according to your needs.
111+
:::
133112

134113
## Up and Running
135114

136-
The tool should have also injected the following npm scripts to your `package.json` if you allowed it to do so during the setup process:
115+
After creating your project, you can use the following npm scripts to develop, test, and build your application:
116+
117+
### MCP Server Development Scripts
137118

138119
```json [package.json]
139120
{
140-
...
141121
"scripts": {
142-
"docs:dev": "vitepress dev docs",
143-
"docs:build": "vitepress build docs",
144-
"docs:preview": "vitepress preview docs"
145-
},
146-
...
122+
"dev": "Start the development server in stdio mode",
123+
"dev:web": "Start the development server in web mode",
124+
"build": "Build the project",
125+
"test": "Run tests (if vitest plugin is selected)",
126+
"coverage": "Generate test coverage report (if vitest plugin is selected)",
127+
"lint": "Run linting (if style plugin is selected)"
128+
}
147129
}
148130
```
149131

150-
The `docs:dev` script will start a local dev server with instant hot updates. Run it with the following command:
132+
To start the development server, run:
151133

152134
::: code-group
153135

154136
```sh [npm]
155-
$ npm run docs:dev
137+
$ npm run dev
156138
```
157139

158140
```sh [pnpm]
159-
$ pnpm run docs:dev
141+
$ pnpm run dev
160142
```
161143

162144
```sh [yarn]
163-
$ yarn docs:dev
164-
```
165-
166-
```sh [bun]
167-
$ bun run docs:dev
145+
$ yarn dev
168146
```
169147

170148
:::
171149

172-
Instead of npm scripts, you can also invoke VitePress directly with:
173-
174-
::: code-group
175-
176-
```sh [npm]
177-
$ npx vitepress dev docs
178-
```
179-
180-
```sh [pnpm]
181-
$ pnpm vitepress dev docs
182-
```
150+
### MCP Client Development Scripts
183151

184-
```sh [yarn]
185-
$ yarn vitepress dev docs
186-
```
152+
The client project includes similar scripts for development, testing, and building:
187153

188-
```sh [bun]
189-
$ bun vitepress dev docs
154+
```json [package.json]
155+
{
156+
"scripts": {
157+
"dev": "Start the client in development mode",
158+
"build": "Build the project",
159+
"test": "Run tests (if vitest plugin is selected)",
160+
"coverage": "Generate test coverage report (if vitest plugin is selected)",
161+
"lint": "Run linting (if style plugin is selected)"
162+
}
163+
}
190164
```
191-
192-
:::
193-
194-
More command line usage is documented in the [CLI Reference](../reference/cli).
195-
196-
The dev server should be running at `http://localhost:5173`. Visit the URL in your browser to see your new site in action!
197-
198-
## What's Next?
199-
200-
- To better understand how markdown files are mapped to generated HTML, proceed to the [Routing Guide](./routing).
201-
202-
- To discover more about what you can do on the page, such as writing markdown content or using Vue Components, refer to the "Writing" section of the guide. A great place to start would be to learn about [Markdown Extensions](./markdown).
203-
204-
- To explore the features provided by the default documentation theme, check out the [Default Theme Config Reference](../reference/default-theme-config).
205-
206-
- If you want to further customize the appearance of your site, explore how to either [Extend the Default Theme](./extending-default-theme) or [Build a Custom Theme](./custom-theme).
207-
208-
- Once your documentation site takes shape, make sure to read the [Deployment Guide](./deploy).

0 commit comments

Comments
 (0)