About Typescript
Typescript is an MCP server published by karankraina in the Developer Tools category: mCP server template using nodejs fastify framework. It has been installed 0 times through Conduid.
The repository has 6 stars and 0 forks, with the last commit 11 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.
Install
npx mcp-typescriptThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Typescript
Powered by Claude · Grounded in docs
Security checks
- ·README presentNot checked yet.
- ·License declaredNot checked yet.
- ·Tests presentNot checked yet.
- ·Dependencies pinnedNot checked yet.
- ·No dynamic code executionNot checked yet.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
MCP Fastify Server Template
A robust template for building Model Context Protocol (MCP) servers using Node.js and the Fastify framework. This template provides a solid foundation for creating MCP-compliant servers with TypeScript support, proper error handling, and session management.
🚀 Features
- MCP Protocol Compliance: Full support for Model Context Protocol specifications
- Fastify Framework: High-performance, low-overhead web framework
- TypeScript Support: Type-safe development with comprehensive type definitions
📋 Prerequisites
- Node.js 22+
- npm or yarn package manager
- TypeScript knowledge (recommended)
🛠️ Installation
-
Clone the repository
git clone https://github.com/karankraina/mcp-fastify.git cd mcp-fastify -
Install dependencies
npm install -
Set up environment variables
cp sample.env .env # Edit .env with your configuration -
Build the project
npm run build -
Start the server
npm start
🏗️ Project Structure
mcp-fastify/
├── src/ # Source TypeScript files
│ ├── server.ts # Main server implementation
│ └── tools/ # MCP tools directory
│ ├── index.ts # Tool registration hub
│ └── divide-numbers.ts # Example divide tool with error handling
├── build/ # Compiled JavaScript output
├── tests/ # Test files
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
├── sample.env # Environment variables template
└── README.md # This file
🔧 Configuration
Environment Variables
| Variable | Description | Default | Required |
|---|---|---|---|
PORT |
Server port number | 3001 |
No |
ENVIRONMENT |
Runtime environment (development, production, test) |
production |
No |
Server Configuration
The server supports different logging configurations based on the environment:
- Development: Pretty-printed logs with timestamps
- Production: JSON structured logs
- Test: Disabled logging
🛠️ Adding New Tools
To add a new MCP tool:
-
Create a new tool file in
src/tools/:// src/tools/your-new-tool.ts import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; export function registerYourNewTool(server: McpServer) { server.registerTool( "your_tool_name", { title: "Your Tool Title", description: "Description of what your tool does", annotations: { destructiveHint: false, openWorldHint: false, }, inputSchema: { param1: z.string().describe("First parameter"), param2: z.number().describe("Second parameter"), }, }, async ({ param1, param2 }) => { try { // Your tool logic here const result = `Processed: ${param1} with ${param2}`; return { content: [{ type: "text", text: result, }] }; } catch (error) { console.error('Error in your tool:', error); return { content: [{ type: "text", text: `Error: ${error instanceof Error ? error.message : String(error)}`, }] }; } } ); } -
Register the tool in
src/tools/index.ts:import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { registerMultiplyNumbersTool } from "./multiply-numbers.js"; import { registerYourNewTool } from "./your-new-tool.js"; export async function registerTools(server: McpServer) { await registerMultiplyNumbersTool(server); await registerYourNewTool(server); } -
Rebuild and test:
npm run build npm start
🧪 Testing
Run the test suite:
npm test
Run tests in watch mode:
npm run test:watch
Run tests with coverage:
npm run test:coverage
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Visit the repository at: https://github.com/karankraina/mcp-fastify
📄 License
This project is licensed under the ISC License - see the LICENSE file for details.
🔗 Links
🙏 Acknowledgments
- Anthropic for the Model Context Protocol
- Fastify Team for the excellent web framework
- Contributors and the open-source community
README mirrored from the source repository 4 months ago. The original is authoritative.