Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mcp-framework",
"version": "0.1.25",
"version": "0.1.26",

"description": "Framework for building Model Context Protocol (MCP) servers in Typescript",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const program = new Command();
program
.name("mcp")
.description("CLI for managing MCP server projects")
.version("0.1.25");
.version("0.1.26");

program
.command("build")
Expand Down
27 changes: 17 additions & 10 deletions src/core/MCPServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@ export class MCPServer {
private shutdownResolve?: () => void;

constructor(config: MCPServerConfig = {}) {
this.basePath = config.basePath
? resolve(config.basePath)
: join(process.cwd(), 'dist');

this.basePath = this.resolveBasePath(config.basePath);
this.serverName = config.name ?? this.getDefaultName();
this.serverVersion = config.version ?? this.getDefaultVersion();
this.transportConfig = config.transport ?? { type: "stdio" };
Expand All @@ -87,13 +84,23 @@ export class MCPServer {
`Initializing MCP Server: ${this.serverName}@${this.serverVersion}`
);

this.toolLoader = new ToolLoader(join(this.basePath, 'tools'));
this.promptLoader = new PromptLoader(join(this.basePath, 'prompts'));
this.resourceLoader = new ResourceLoader(join(this.basePath, 'resources'));
this.toolLoader = new ToolLoader(this.basePath);
this.promptLoader = new PromptLoader(this.basePath);
this.resourceLoader = new ResourceLoader(this.basePath);

logger.debug(`Looking for tools in: ${join(dirname(this.basePath), 'tools')}`);
logger.debug(`Looking for prompts in: ${join(dirname(this.basePath), 'prompts')}`);
logger.debug(`Looking for resources in: ${join(dirname(this.basePath), 'resources')}`);
}

logger.debug(`Looking for tools in: ${join(this.basePath, 'tools')}`);
logger.debug(`Looking for prompts in: ${join(this.basePath, 'prompts')}`);
logger.debug(`Looking for resources in: ${join(this.basePath, 'resources')}`);
private resolveBasePath(configPath?: string): string {
if (configPath) {
return configPath;
}
if (process.argv[1]) {
return process.argv[1];
}
return process.cwd();
}

private createTransport(): BaseTransport {
Expand Down