Skip to main content
Glama
aaronfeingold

MCP Project Context Server

start_session

Initiate a development session by specifying project ID and session goals, enabling consistent coding context using the MCP Project Context Server.

Instructions

Start a new development session

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
goalsYesSession goals
projectIdYesProject ID

Implementation Reference

  • The handler function that implements the core logic of the start_session tool by creating a new session via ProjectStore and returning the session ID.
    async ({ projectId, goals }) => { try { const session = await this.store.createSession({ projectId, startTime: new Date().toISOString(), goals, achievements: [], blockers: [], nextSession: [], }); return { content: [ { type: "text", text: `Session started with ID: ${session.sessionId}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error starting session: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } }
  • Input schema definition for the start_session tool using Zod for validation of projectId and goals parameters.
    { title: "Start Session", description: "Start a new development session", inputSchema: { projectId: z.string().describe("Project ID"), goals: z.array(z.string()).describe("Session goals"), },
  • src/server.ts:364-405 (registration)
    Registration of the start_session tool on the MCP server, including schema and handler.
    this.server.registerTool( "start_session", { title: "Start Session", description: "Start a new development session", inputSchema: { projectId: z.string().describe("Project ID"), goals: z.array(z.string()).describe("Session goals"), }, }, async ({ projectId, goals }) => { try { const session = await this.store.createSession({ projectId, startTime: new Date().toISOString(), goals, achievements: [], blockers: [], nextSession: [], }); return { content: [ { type: "text", text: `Session started with ID: ${session.sessionId}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error starting session: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } } );
  • Supporting method in ProjectStore that creates and persists a new session file to disk, used by the start_session handler.
    async createSession( sessionData: Omit<SessionContext, "sessionId"> ): Promise<SessionContext> { const session: SessionContext = { ...sessionData, sessionId: uuidv4(), }; const validated = SessionContextSchema.parse(session); const filePath = path.join(this.sessionsDir, `${session.sessionId}.json`); await fs.writeJson(filePath, validated, { spaces: 2 }); return validated; }
  • Zod schema for SessionContext type, used to validate session data in ProjectStore.createSession.
    export const SessionContextSchema = z.object({ sessionId: z.string(), projectId: z.string(), startTime: z.string(), endTime: z.string().optional(), goals: z.array(z.string()).default([]), achievements: z.array(z.string()).default([]), blockers: z.array(z.string()).default([]), nextSession: z.array(z.string()).default([]), });

Other Tools

Related 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/aaronfeingold/mcp-project-context'

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