MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / mcp_tools

Function mcp_tools

src/codegraphcontext/cli/main.py:160–188  ·  view source on GitHub ↗

List all available MCP tools. Shows all tools that can be called by AI assistants through the MCP interface.

()

Source from the content-addressed store, hash-verified

158
159@mcp_app.command("tools")
160def mcp_tools():
161 """
162 List all available MCP tools.
163
164 Shows all tools that can be called by AI assistants through the MCP interface.
165 """
166 _load_credentials()
167 console.print("[bold green]Available MCP Tools:[/bold green]")
168 try:
169 # Instantiate the server to access the tool definitions.
170 server = MCPServer()
171 tools = server.tools.values()
172
173 table = Table(show_header=True, header_style="bold magenta")
174 table.add_column("Tool Name", style="dim", width=30)
175 table.add_column("Description")
176
177 for tool in sorted(tools, key=lambda t: t['name']):
178 table.add_row(tool['name'], tool['description'])
179
180 console.print(table)
181
182 except ValueError as e:
183 console.print(f"[bold red]Error loading tools:[/bold red] {e}")
184 console.print("Please ensure your database is configured correctly.")
185 raise typer.Exit(code=1) from e
186 except Exception as e:
187 console.print(f"[bold red]An unexpected error occurred:[/bold red] {e}")
188 raise typer.Exit(code=1) from e
189
190# Abbreviation for mcp setup
191@app.command("m", rich_help_panel="Shortcuts")

Callers

nothing calls this directly

Calls 6

MCPServerClass · 0.90
_load_credentialsFunction · 0.85
printMethod · 0.80
add_columnMethod · 0.80
add_rowMethod · 0.80
valuesMethod · 0.45

Tested by

no test coverage detected