Skip to main content
Glama
itsocialist

Claude Code Connector MCP

by itsocialist

register_project

Register project directories to enable Claude Code Connector access for planning, spec storage, and CLI invocation across development interfaces.

Instructions

Register a project directory for Claude Code Connector access

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesHuman-readable project name
rootPathYesAbsolute path to project root
idNoOptional unique ID (auto-generated if not provided)
specPathsNoRelative paths for spec/doc storage

Implementation Reference

  • The main handler function that implements the register_project tool. Validates input arguments, checks path existence, generates project ID if needed, creates a Project object, persists it using ProjectManager, and returns success response.
    export async function registerProject(args: RegisterProjectArgs): Promise<{
        success: boolean;
        projectId: string;
        message: string;
    }> {
        const projectManager = new ProjectManager();
    
        // 1. Validate arguments
        if (!args.name || !args.rootPath) {
            throw new MCPError(
                ErrorCode.INVALID_ARGUMENTS,
                'Name and rootPath are required'
            );
        }
    
        // 3. Validate path exists
        const exists = await projectManager.validateProjectPath(args.rootPath);
        if (!exists) {
            throw new MCPError(
                ErrorCode.INVALID_PATH,
                `Project path does not exist or is not a directory: ${args.rootPath}`,
                "Please create the directory first or check the path."
            );
        }
    
        // 4. Generate ID if not provided
        const id = args.id || generateId(args.name);
        if (!id) {
            throw new MCPError(ErrorCode.INVALID_ARGUMENTS, "Could not generate valid ID from name");
        }
    
        const now = new Date().toISOString();
    
        const project: Project = {
            id,
            name: args.name,
            rootPath: args.rootPath,
            specPaths: args.specPaths || ['docs/', 'specs/'],
            claudeStatePath: '.claude/',
            active: true,
            created: now,
            lastAccessed: now
        };
    
        // 2. Check if project already exists (handled inside addProject)
        // 5. Save to projects.json
        await projectManager.addProject(project);
    
        // 6. Return success
        return {
            success: true,
            projectId: id,
            message: `Project '${args.name}' registered successfully at ${args.rootPath}`
        };
    }
  • TypeScript interface defining the input arguments for the register_project tool.
    export interface RegisterProjectArgs {
      name: string;
      rootPath: string;
      id?: string;
      specPaths?: string[];
    }
  • src/index.ts:57-68 (registration)
    MCP tool registration in the ListTools handler, defining the name, description, and input schema for 'register_project'.
    name: 'register_project',
    description: 'Register a project directory for Claude Code Connector access',
    inputSchema: {
      type: 'object',
      properties: {
        name: { type: 'string', description: 'Human-readable project name' },
        rootPath: { type: 'string', description: 'Absolute path to project root' },
        id: { type: 'string', description: 'Optional unique ID (auto-generated if not provided)' },
        specPaths: { type: 'array', items: { type: 'string' }, description: 'Relative paths for spec/doc storage' },
      },
      required: ['name', 'rootPath'],
    },
  • src/index.ts:121-124 (registration)
    Tool execution routing in the CallToolRequest handler, dispatching to the registerProject function for 'register_project'.
    case 'register_project':
      return {
        content: [{ type: 'text', text: JSON.stringify(await registerProject(args as unknown as RegisterProjectArgs), null, 2) }]
      };
  • Helper function to generate a project ID from the project name by sanitizing it.
    function generateId(name: string): string {
        return name
            .toLowerCase()
            .replace(/[^a-z0-9]+/g, '-')
            .replace(/^-|-$/g, '');
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool 'registers' a project directory, implying a write/mutation operation, but doesn't disclose critical traits like whether this requires specific permissions, if it's idempotent, what happens on duplicate registration, or any rate limits. The mention of 'access' hints at enabling future operations but lacks details on effects or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose ('register a project directory') without unnecessary words. Every part earns its place by specifying the resource and context ('for Claude Code Connector access'), making it appropriately sized for the tool's complexity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool involves mutation (registration) with no annotations and no output schema, the description is incomplete. It doesn't explain what the registration enables, potential side effects, error conditions, or return values. For a 4-parameter tool that likely modifies system state, more context on behavior and outcomes is needed to guide an agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 4 parameters thoroughly (e.g., 'name' as human-readable, 'rootPath' as absolute path). The description adds no additional meaning beyond what the schema provides, such as explaining how 'specPaths' relate to 'Claude Code Connector' functionality. Baseline 3 is appropriate when schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('register') and resource ('project directory'), specifying it's for 'Claude Code Connector access'. It distinguishes from siblings like 'list_projects' (listing vs registering) and 'read_from_project/write_to_project' (accessing vs registering). However, it doesn't explicitly differentiate from potential overlapping tools beyond the given siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like 'list_projects' (which might show existing registrations) or prerequisites for registration. It mentions 'Claude Code Connector access' but doesn't clarify if this is for initial setup, re-registration, or specific contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsocialist/claude-code-connector-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server