Skip to content

Commit d02637e

Browse files
committed
Fix READMEs, overwrite the template's README with the one from the CLI package
1 parent c68c869 commit d02637e

File tree

4 files changed

+94
-75
lines changed

4 files changed

+94
-75
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
![NPM Version](https://img.shields.io/npm/v/create-mcp-ts)
44

5+
> [!NOTE]
6+
> The `create-mcp-ts` npm package is located in [packages/create-mcp-ts](./packages/create-mcp-ts/README.md).
7+
58
[packages/create-mcp-ts](./packages/create-mcp-ts/README.md)
69

710
Create a new MCP server in TypeScript, batteries included.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Getting started with your MCP server
2+
3+
This project was bootstrapped with [create-mcp-ts](https://github.com/stephencme/create-mcp-ts).
4+
5+
It provides a basic template for building an MCP (Model Context Protocol) server using TypeScript.
6+
7+
## Quick start
8+
9+
```shell
10+
npm run setup
11+
npm run dev
12+
```
13+
14+
## Available scripts
15+
16+
In the project directory, you can run:
17+
18+
### `npm run dev`
19+
20+
Builds the MCP server to the `dist` folder and watches source files for changes.\
21+
Changes will trigger a rebuild of the server.
22+
23+
### `npm run build`
24+
25+
Builds the MCP server to the `dist` folder.\
26+
It bundles your code for production use e.g. publishing to npm.
27+
28+
### `npm run setup`
29+
30+
This script helps configure your MCP server in Cursor, Windsurf, and Claude Desktop.\
31+
It checks the respective configuration files (`.json`) and adds an entry for your server if it doesn't exist, pointing to the server script (`dist/index.js`).
32+
33+
```json
34+
{
35+
"mcpConfig": {
36+
"your-mcp-server": {
37+
"command": "node",
38+
"args": ["/path/to/your-mcp-server/dist/index.js"]
39+
}
40+
}
41+
}
42+
```
43+
44+
**Note**: You might need to adjust the `"command"` if your Node.js installation is not in the default system PATH, especially when using version managers like `nvm` or `nodenv`. See the [Troubleshooting](#troubleshooting-your-mcp-server-configuration) section in the `create-mcp-ts` README for details.
45+
46+
### `npm run eject`
47+
48+
**This is a one-way operation. Once you `eject`, you can't go back!**
49+
50+
If you aren't satisfied with the included build tools (`mcp-scripts`), you can `eject` at any time. This command will remove the `mcp-scripts` dependency from your project.
51+
52+
Instead, it will copy any configuration files and the transitive dependencies right into your project so you have full control over them. All commands except `eject` will still work, but they will point to the copied configurations. At this point you're on your own.
53+
54+
You don't have to ever use `eject`. The curated feature set is suitable for many deployments. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
55+
56+
## Publishing your MCP server
57+
58+
If you plan to share your MCP server, you can publish it to npm:
59+
60+
1. Set `"version"` in `package.json` and ensure `"private"` is set to `false`.
61+
2. Run `npm install`.
62+
3. Run `npm run build`.
63+
4. Run `npm login` (if needed).
64+
5. Run `npm publish`.
65+
66+
## Troubleshooting
67+
68+
See the [Troubleshooting](https://github.com/stephencme/create-mcp-ts#troubleshooting-your-mcp-server) section in the `create-mcp-ts` README for common issues.
69+
70+
## Learn more
71+
72+
- **Model Context Protocol (MCP)**: Learn more about the protocol at [modelcontextprotocol.io](https://modelcontextprotocol.io/).
73+
- **create-mcp-ts**: Check out the tool that created this template [here](https://github.com/stephencme/create-mcp-ts).
74+
- **TypeScript**: Learn more about TypeScript [here](https://www.typescriptlang.org/).

packages/create-mcp-ts/src/index.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ async function run() {
105105
// Copy files with special file name handling
106106
const templateFiles = fs
107107
.readdirSync(localTemplatePath)
108-
.filter((file) => !["node_modules", ".git"].includes(file));
108+
.filter(
109+
(file) => !["node_modules", ".git", "README.md"].includes(file)
110+
);
109111

110112
templateFiles.forEach((file) => {
111113
const srcPath = path.join(localTemplatePath, file);
@@ -139,7 +141,9 @@ async function run() {
139141
);
140142
const templateFiles = fs
141143
.readdirSync(templatePath)
142-
.filter((file) => !["node_modules", ".git"].includes(file));
144+
.filter(
145+
(file) => !["node_modules", ".git", "README.md"].includes(file)
146+
);
143147

144148
// Copy each file/directory from the template with special file name handling
145149
templateFiles.forEach((file) => {
@@ -155,6 +159,15 @@ async function run() {
155159
await executeCmd("npm", ["uninstall", templateName], resolvedProjectPath);
156160
}
157161

162+
// Copy README.template.md to README.md
163+
const readmeTemplatePath = path.join(__dirname, "..", "README.template.md");
164+
if (fs.existsSync(readmeTemplatePath)) {
165+
fs.copyFileSync(
166+
readmeTemplatePath,
167+
path.join(resolvedProjectPath, "README.md")
168+
);
169+
}
170+
158171
console.log("Template copied successfully.");
159172
console.log();
160173
} catch (error) {
Lines changed: 2 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,3 @@
1-
# Getting started with your MCP server
1+
# mcp-ts-template-default
22

3-
This project was bootstrapped with [create-mcp-ts](https://github.com/stephencme/create-mcp-ts).
4-
5-
It provides a basic template for building an MCP (Model Context Protocol) server using TypeScript.
6-
7-
## Quick start
8-
9-
```shell
10-
npm run setup
11-
npm run dev
12-
```
13-
14-
## Available scripts
15-
16-
In the project directory, you can run:
17-
18-
### `npm run dev`
19-
20-
Builds the MCP server to the `dist` folder and watches source files for changes.\
21-
Changes will trigger a rebuild of the server.
22-
23-
### `npm run build`
24-
25-
Builds the MCP server to the `dist` folder.\
26-
It bundles your code for production use e.g. publishing to npm.
27-
28-
### `npm run setup`
29-
30-
This script helps configure your MCP server in Cursor, Windsurf, and Claude Desktop.\
31-
It checks the respective configuration files (`.json`) and adds an entry for your server if it doesn't exist, pointing to the server script (`dist/index.js`).
32-
33-
```json
34-
{
35-
"mcpConfig": {
36-
"your-mcp-server": {
37-
"command": "node",
38-
"args": ["/path/to/your-mcp-server/dist/index.js"]
39-
}
40-
}
41-
}
42-
```
43-
44-
**Note**: You might need to adjust the `"command"` if your Node.js installation is not in the default system PATH, especially when using version managers like `nvm` or `nodenv`. See the [Troubleshooting](#troubleshooting-your-mcp-server-configuration) section in the `create-mcp-ts` README for details.
45-
46-
### `npm run eject`
47-
48-
**This is a one-way operation. Once you `eject`, you can't go back!**
49-
50-
If you aren't satisfied with the included build tools (`mcp-scripts`), you can `eject` at any time. This command will remove the `mcp-scripts` dependency from your project.
51-
52-
Instead, it will copy any configuration files and the transitive dependencies right into your project so you have full control over them. All commands except `eject` will still work, but they will point to the copied configurations. At this point you're on your own.
53-
54-
You don't have to ever use `eject`. The curated feature set is suitable for many deployments. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
55-
56-
## Publishing your MCP server
57-
58-
If you plan to share your MCP server, you can publish it to npm:
59-
60-
1. Set `"version"` in `package.json` and ensure `"private"` is set to `false`.
61-
2. Run `npm install`.
62-
3. Run `npm run build`.
63-
4. Run `npm login` (if needed).
64-
5. Run `npm publish`.
65-
66-
## Troubleshooting
67-
68-
See the [Troubleshooting](https://github.com/stephencme/create-mcp-ts#troubleshooting-your-mcp-server) section in the `create-mcp-ts` README for common issues.
69-
70-
## Learn more
71-
72-
- **Model Context Protocol (MCP)**: Learn more about the protocol at [modelcontextprotocol.io](https://modelcontextprotocol.io/).
73-
- **create-mcp-ts**: Check out the tool that created this template [here](https://github.com/stephencme/create-mcp-ts).
74-
- **TypeScript**: Learn more about TypeScript [here](https://www.typescriptlang.org/).
3+
Default project template for `create-mcp-ts`.

0 commit comments

Comments
 (0)