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

Function mcp_tools

src/codegraphcontext/cli/main.py:157–185  ·  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

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

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected