MCPcopy Index your code
hub / github.com/codeaashu/claude-code / createServer

Function createServer

mcp-server/src/server.ts:148–943  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

146// ---------------------------------------------------------------------------
147
148export function createServer(): Server {
149 const server = new Server(
150 { name: "claude-code-explorer", version: "1.1.0" },
151 {
152 capabilities: {
153 tools: {},
154 resources: {},
155 prompts: {},
156 },
157 }
158 );
159
160 // ---- Resources ---------------------------------------------------------
161
162 server.setRequestHandler(ListResourcesRequestSchema, async () => ({
163 resources: [
164 {
165 uri: "claude-code://architecture",
166 name: "Architecture Overview",
167 description:
168 "High-level overview of the Claude Code source architecture",
169 mimeType: "text/markdown",
170 },
171 {
172 uri: "claude-code://tools",
173 name: "Tool Registry",
174 description: "List of all agent tools with their files",
175 mimeType: "application/json",
176 },
177 {
178 uri: "claude-code://commands",
179 name: "Command Registry",
180 description: "List of all slash commands",
181 mimeType: "application/json",
182 },
183 ],
184 }));
185
186 server.setRequestHandler(
187 ListResourceTemplatesRequestSchema,
188 async () => ({
189 resourceTemplates: [
190 {
191 uriTemplate: "claude-code://source/{path}",
192 name: "Source file",
193 description:
194 "Read a source file from the Claude Code src/ directory",
195 mimeType: "text/plain",
196 },
197 ],
198 })
199 );
200
201 server.setRequestHandler(
202 ReadResourceRequestSchema,
203 async (request: { params: { uri: string } }) => {
204 const { uri } = request.params;
205

Callers 11

startMethod · 0.85
startNodeRelayFunction · 0.85
constructorMethod · 0.85
findAvailablePortFunction · 0.85
waitForCallbackFunction · 0.85
performMCPOAuthFlowFunction · 0.85
pty-server.tsFile · 0.85
startStreamableHTTPFunction · 0.85
startLegacySSEFunction · 0.85
mainFunction · 0.85
vercelApp.tsFile · 0.85

Calls 12

getToolListFunction · 0.85
getCommandListFunction · 0.85
safePathFunction · 0.85
dirExistsFunction · 0.85
listDirFunction · 0.85
fileExistsFunction · 0.85
walkFilesFunction · 0.85
readFileMethod · 0.80
maxMethod · 0.80
toStringMethod · 0.65
resolveMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected