Template
8707d66108
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 22s
Branch Policy Check / Verify merge target (pull_request) Successful in 2s
Universal: PR Check / Branch Policy (pull_request) Successful in 3s
Universal: PR Check / Secret Scan (pull_request) Successful in 7s
Generic: Project CI / Lint & Validate (pull_request) Successful in 24s
Universal: PR Check / Validate PR (pull_request) Successful in 7s
Universal: Auto-Assign / Assign unassigned issues and PRs (pull_request_target) Successful in 3s
Branch Cleanup / Delete merged branch (pull_request) Successful in 2s
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Generic: Project CI / Tests (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Standardize the template on `source/` as the source input directory and retire user-facing `src/` references, per issue #34. Changes: - git mv src -> source (history preserved for all .ts files) - source/*.ts: update PATH headers /src/ -> /source/ - tsconfig.json: rootDir and include point at source/ - package.json: lint script targets source/ - Makefile: add SRC_DIR := source (CI resolver source of truth) - README.md, CLAUDE.md, docs/ARCHITECTURE.md: source path refs -> source/ The `dist/` directory is retained solely as tsc's compiled build output (outDir), which is already gitignored and never committed/published; releases go through the MokoGIT release system. No new dist/ references were introduced. Authored-by: Moko Consulting
85 lines
4.0 KiB
Markdown
85 lines
4.0 KiB
Markdown
# Template-NPM
|
|
|
|
   
|
|
|
|
Template repository for creating MokoCLI-compliant Model Context Protocol (MCP) API servers. Provides the scaffolding, configuration patterns, and architecture conventions used by all Moko Consulting MCP servers, enabling AI assistants like Claude to interact with REST APIs through a standardized tool interface.
|
|
|
|
## Features
|
|
|
|
- **MCP server scaffolding** -- pre-configured TypeScript project structure with entry point, tool registration, and stdio transport ready to go
|
|
- **Multi-connection support** -- built-in `config.json` pattern for managing multiple named API connections with a default fallback; all tools accept an optional `connection` parameter
|
|
- **REST API bridge architecture** -- standardized pattern for bridging any REST API as MCP tools, with typed request/response handling
|
|
- **TypeScript-first** -- full TypeScript setup with `tsconfig.json`, strict mode, and ES module output
|
|
- **Build tooling** -- Makefile with `build`, `dev`, `clean`, and `lint` targets; npm scripts for compilation and development
|
|
- **MokoCLI compliant** -- follows all Moko Consulting governance conventions: file headers, commit messages, `.gitattributes`, `.gitmessage`, PR/issue templates
|
|
- **Example configuration** -- `config.example.json` demonstrates the connection configuration schema
|
|
- **Documentation templates** -- wiki pages for API reference, architecture overview, and installation pre-generated
|
|
|
|
## Installation
|
|
|
|
1. Create a new repository from this template (or clone directly):
|
|
```bash
|
|
git clone https://git.mokoconsulting.tech/MokoConsulting/Template-NPM.git my-mcp-server
|
|
cd my-mcp-server
|
|
```
|
|
2. Install dependencies:
|
|
```bash
|
|
npm install
|
|
```
|
|
3. Copy and configure the connection file:
|
|
```bash
|
|
cp config.example.json config.json
|
|
# Edit config.json with your API credentials
|
|
```
|
|
4. Build the project:
|
|
```bash
|
|
npm run build
|
|
```
|
|
5. Run the server:
|
|
```bash
|
|
node build/index.js
|
|
```
|
|
|
|
## Configuration
|
|
|
|
| Path | Purpose |
|
|
|---|---|
|
|
| `source/` | TypeScript source files (server entry, tool definitions, API client) |
|
|
| `config.example.json` | Example multi-connection configuration schema |
|
|
| `config.json` | Local connection configuration (gitignored) |
|
|
| `package.json` | npm dependencies and scripts |
|
|
| `tsconfig.json` | TypeScript compiler configuration |
|
|
| `scripts/` | Build and development utility scripts |
|
|
| `docs/` | Developer documentation |
|
|
| `Makefile` | Build, dev, clean, and lint targets |
|
|
|
|
## Requirements
|
|
|
|
- Node.js 20.0.0 or later
|
|
- npm 9+
|
|
- TypeScript 5+ (installed via npm)
|
|
|
|
## Documentation
|
|
|
|
Full documentation is available on the [Wiki](https://git.mokoconsulting.tech/MokoConsulting/Template-NPM/wiki), including:
|
|
|
|
- [API](https://git.mokoconsulting.tech/MokoConsulting/Template-NPM/wiki/API) -- tool reference and connection parameter documentation
|
|
- [ARCHITECTURE](https://git.mokoconsulting.tech/MokoConsulting/Template-NPM/wiki/ARCHITECTURE) -- MCP server design and REST API bridge pattern
|
|
- [INSTALLATION](https://git.mokoconsulting.tech/MokoConsulting/Template-NPM/wiki/INSTALLATION) -- setup prerequisites and configuration guide
|
|
|
|
## Contributing
|
|
|
|
See the wiki for development guidelines and contribution instructions.
|
|
|
|
## License
|
|
|
|
This project is licensed under the GNU General Public License v3.0 or later -- see the [LICENSE](LICENSE) file.
|
|
|
|
---
|
|
|
|
*[Moko Consulting](https://mokoconsulting.tech) -- [MokoCLI](https://git.mokoconsulting.tech/MokoConsulting/mokocli/wiki/Home)*
|
|
|
|
## Template CI Notes
|
|
|
|
Build/CI/release/version workflows are guarded to skip template repos (Template-*) and only run in repos created from them.
|