
ts pkg distro
一个用于 TypeScript 包分发的 FastMCP 服务器,提供发布到 npm 的分步指导。
Repository Info
About This Server
一个用于 TypeScript 包分发的 FastMCP 服务器,提供发布到 npm 的分步指导。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
@agentience/ts-pkg-distro Server
A FastMCP server providing resources for TypeScript package distribution.
Overview
This MCP server provides access to markdown documents that guide you, or preferrably a coding agent, through the process of setting up and publishing a TypeScript package to npm. Each step of the process is available as a separate resource, with an orchestrator that provides an overview of the entire process. The package has been initially designed with Roo Code's Boomerang mode in mind. It may work well using other coding tools (Windsurf, Cursor, Cline), but they haven't been tested.
Usage with Roo Code's Boomerang Mode
To use this server with Roo Code's Boomerang Mode, use the following prompt:
Follow the instructions found at ts-pkg-distro://orchestrator
What Happens After Submitting the Prompt
When you submit the above prompt in Roo Code's Boomerang Mode, the following workflow is initiated:
-
Orchestrator Activation: Boomerang Mode connects to the ts-pkg-distro MCP server and accesses the orchestrator guide, which provides an overview of the entire TypeScript package distribution process.
-
Step-by-Step Guidance: The orchestrator breaks down the process into 8 sequential steps:
- Project Assessment: Evaluates your current project setup to determine which steps are needed
- Initial Setup: Creates the basic project structure if needed
- TypeScript Configuration: Configures TypeScript specifically for package distribution
- Package Configuration: Sets up package.json for npm distribution
- Executable Setup (optional): Makes your package executable with npx if desired
- Build and Test: Builds your package and tests it locally
- Publishing Preparation: Prepares your package for publishing
- Publishing to npm: Publishes your package to the npm registry
-
Interactive Workflow: For each step, Boomerang Mode will:
- Explain the purpose of the step
- Determine if the step is necessary for your project
- Provide detailed instructions for completing the step
- Execute necessary commands with your permission
- Verify the results before proceeding to the next step
-
Adaptive Assistance: The workflow adapts based on your project's current state:
- If you have an existing project, it will assess what's already set up
- If you're starting from scratch, it will guide you through the complete setup
- It will skip steps that aren't relevant to your specific package
-
Completion and Follow-up: After completing all necessary steps:
- Your TypeScript package will be properly configured and published to npm
- You'll receive guidance on maintaining and updating your package
- You can optionally set up CI/CD for automated publishing
This guided approach ensures that your TypeScript package follows best practices for npm distribution, with proper configuration for TypeScript declaration files, package exports, and command-line functionality if needed.
MCP Resources
The server provides the following resources:
ts-pkg-distro://orchestrator- Main guide with overview of the entire processts-pkg-distro://project-assessment- Assess your current project structurets-pkg-distro://initial-setup- Initial setup for a TypeScript packagets-pkg-distro://typescript-configuration- Configure TypeScript for package distributionts-pkg-distro://package-configuration- Package.json configuration for distributionts-pkg-distro://executable-setup- Make your package executable with npxts-pkg-distro://build-and-test- Build and test your TypeScript packagets-pkg-distro://publishing-preparation- Prepare your package for publishingts-pkg-distro://publishing-to-npm- Publish your package to npm registryts-pkg-distro://npm-organizations-guide- Comprehensive guide to npm organizations (scopes)ts-pkg-distro://index- Index of all available resources
MCP Tools
The server provides tools to access the guides programmatically:
get_guide- Get a specific guide by nameget_orchestrator_guide- Get the main orchestrator guideget_project_assessment_guide- Get the project assessment guideget_initial_setup_guide- Get the initial setup guideget_typescript_configuration_guide- Get the TypeScript configuration guideget_package_configuration_guide- Get the package configuration guideget_executable_setup_guide- Get the executable setup guideget_build_and_test_guide- Get the build and test guideget_publishing_preparation_guide- Get the publishing preparation guideget_publishing_to_npm_guide- Get the publishing to npm guideget_npm_organizations_guide- Get the npm organizations guidelist_guides- Get a list of all available guidesget_next_guide- Get the next guide in sequence after the current one
MCP Server Configuration
You can configure the MCP server using multiple methods, with the following priority order (highest to lowest):
- Command-line arguments
- Environment variables
- Configuration file
- Default values
By default, the server uses the package.json for version information and sets the server name to lowercase 'ts-pkg-distro'.
Configuration Methods
1. Configuration File
The server looks for a file named mcp-config.json in the current directory by default, but you can specify a different path using the --config flag.
{
"server": {
"name": "custom-server-name",
"version": "1.0.0"
},
"transport": {
"type": "stdio",
"options": {
// Transport-specific options
}
},
"npm-org": "agentience"
}
2. Environment Variables
You can use environment variables with the prefix TS_PKG_DISTRO_ to override configuration values:
TS_PKG_DISTRO_SERVER_NAME: Server nameTS_PKG_DISTRO_TRANSPORT_TYPE: Transport typeTS_PKG_DISTRO_TRANSPORT_PORT: HTTP/WebSocket portTS_PKG_DISTRO_TRANSPORT_HOST: HTTP hostTS_PKG_DISTRO_NPM_ORG: npm organizationTS_PKG_DISTRO_VERBOSE: Enable verbose logging
Example:
TS_PKG_DISTRO_SERVER_NAME=my-server TS_PKG_DISTRO_VERBOSE=true npx @agentience/ts-pkg-distro
3. Command-line Arguments
You can use command-line arguments to override configuration values:
--server-name: Server name--transport-type: Transport type--transport-port: HTTP/WebSocket port--transport-host: HTTP host--npm-org: npm organization--verbose: Enable verbose logging--config: Path to configuration file
Arguments can be specified in two formats:
npx @agentience/ts-pkg-distro --server-name=my-server --verbose
# or
npx @agentience/ts-pkg-distro --server-name my-server --verbose
Configuration Options
Server Options
name: Custom name for the MCP server (default: "ts-pkg-distro")
Transport Options
type: The transport type to use (default: "stdio")- Supported values: "stdio", "http", "websocket"
options: Transport-specific configuration options- For HTTP:
{ "port": 3000, "host": "localhost" } - For WebSocket:
{ "port": 3000 }
- For HTTP:
npm Organization Options
npm-org: Optional organization namespace for npm publishing- When specified, automatically:
- Updates the package name in package.json to include your organization scope (e.g.,
@agentience/package-name) - Adds the
--access publicflag when publishing
- Updates the package name in package.json to include your organization scope (e.g.,
- Useful for:
- Maintaining consistent package naming across environments
- Simplifying CI/CD pipelines
- Managing organization scopes for projects with multiple packages
- When specified, automatically:
Example Configurations
Basic Configuration (stdio)
{
"server": {
"name": "ts-pkg-distro"
},
"transport": {
"type": "stdio"
}
}
Basic Configuration with npm Organization
{
"server": {
"name": "ts-pkg-distro"
},
"transport": {
"type": "stdio"
},
"npm-org": "agentience"
}
HTTP Server Configuration
{
"server": {
"name": "ts-pkg-distro"
},
"transport": {
"type": "http",
"options": {
"port": 3000,
"host": "localhost"
}
}
}
HTTP Server with npm Organization
{
"server": {
"name": "ts-pkg-distro"
},
"transport": {
"type": "http",
"options": {
"port": 3000,
"host": "localhost"
}
},
"npm-org": "agentience"
}
Usage with npx
You can run the MCP server directly using npx without installing it:
npx @agentience/ts-pkg-distro
To use a custom configuration file:
npx @agentience/ts-pkg-distro --config ./my-config.json
Command-line Examples
# Use a custom server name
npx @agentience/ts-pkg-distro --server-name=my-custom-server
# Use HTTP transport on port 4000
npx @agentience/ts-pkg-distro --transport-type=http --transport-port=4000
# Use a custom configuration file with verbose logging
npx @agentience/ts-pkg-distro --config=./my-config.json --verbose
# Use npm organization with environment variables
TS_PKG_DISTRO_NPM_ORG=myorg npx @agentience/ts-pkg-distro
Example Configuration Files
The package includes example configuration files in the examples directory:
examples/mcp-config.json- Basic stdio configurationexamples/http-config.json- HTTP server configuration
You can modify these example configurations to include the npm-org option for publishing packages under your organization scope.
You can use these as templates for your own configuration:
# Copy an example configuration
cp node_modules/@agentience/ts-pkg-distro/examples/http-config.json ./mcp-config.json
# Edit as needed
nano mcp-config.json
# Run with the configuration
npx @agentience/ts-pkg-distro
Integration with Roo Code
To use this MCP server with Roo Code or other MCP clients, you need to configure it in the client's MCP server configuration file. For Roo Code, this is typically located at .roo/mcp.json.
Roo Code Configuration
Add the following to your .roo/mcp.json file:
{
"mcpServers": {
"ts-pkg-distro": {
"command": "npx",
"args": [
"-y",
"@agentience/ts-pkg-distro"
]
}
}
}
With Custom Configuration
To use a custom configuration file with Roo Code:
{
"mcpServers": {
"ts-pkg-distro": {
"command": "npx",
"args": [
"-y",
"@agentience/ts-pkg-distro",
"--config",
"./path/to/your/config.json"
]
}
}
}
Accessing Resources
Once configured, you can access the resources in your Roo Code prompts:
Follow the instructions found at ts-pkg-distro://orchestrator
Or use the tools directly:
Use the ts-pkg-distro server to get the publishing-to-npm guide
Development
To start the server:
-
Install dependencies:
npm install -
Build the server:
npm run build -
Start the server:
npm start
For local development with hot reloading:
npm run dev
Scripts
The project includes various utility scripts in the scripts/ directory:
-
Simulation Scripts:
simulate-roo-*.js- Scripts for simulating Roo Code integration in different modessimulate-roo-mcp.js- Basic MCP server simulationsimulate-roo-mcp-exact.js- Exact MCP protocol simulationsimulate-roo-linked.js- Linked package simulationsimulate-roo-capture.js- Output capture simulationsimulate-roo-mcp-local.js- Local MCP server simulation
-
Verification Scripts:
verify-app-integration.js- Verify application integrationverify-app-logging.js- Verify application loggingverify-fastmcp-logging.js- Verify FastMCP loggingverify-npm-org.js- Verify npm organization configuration
-
Utility Scripts:
run-npx.sh- Helper script for running the package with npx
These scripts are primarily used for development, testing, and verification purposes.
Implementation
This server is built using FastMCP, a TypeScript framework for building MCP servers. The server provides both URI-based resource access and tool-based resource access.
Directory Structure
ts-pkg-distro-mcp/
├── dist/ # Compiled JavaScript (generated)
├── examples/ # Example configuration files
│ ├── http-config.json
│ └── mcp-config.json
├── scripts/ # Utility and testing scripts
│ ├── run-npx.sh
│ ├── simulate-roo-*.js
│ └── verify-*.js
├── src/
│ ├── index.ts # Main server entry point
│ ├── resources.ts # Resource handler implementation
│ └── markdown/ # Markdown resource files
│ ├── 00-Orchestrator.md
│ ├── 01-Project-Assessment.md
│ ├── 02-Initial-Setup.md
│ ├── 03-TypeScript-Configuration.md
│ ├── 04-Package-Configuration.md
│ ├── 05-Executable-Setup.md
│ ├── 06-Build-and-Test.md
│ ├── 07-Publishing-Preparation.md
│ ├── 08-Publishing-to-npm.md
│ └── 09-npm-Organizations-Guide.md
├── package.json
└── tsconfig.json
License
MIT
Quick Start
Clone the repository
git clone https://github.com/agentience/ts-pkg-distroInstall dependencies
cd ts-pkg-distro
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.