nia-mcp-server 1.0.19__py3-none-any.whl → 1.0.20__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nia-mcp-server might be problematic. Click here for more details.

@@ -2,4 +2,4 @@
2
2
  NIA MCP Server - Proxy server for NIA Knowledge Agent
3
3
  """
4
4
 
5
- __version__ = "1.0.19"
5
+ __version__ = "1.0.20"
@@ -28,7 +28,7 @@ class NIAApiClient:
28
28
  self.client = httpx.AsyncClient(
29
29
  headers={
30
30
  "Authorization": f"Bearer {api_key}",
31
- "User-Agent": "nia-mcp-server/1.0.0",
31
+ "User-Agent": "nia-mcp-server/1.0.20",
32
32
  "Content-Type": "application/json"
33
33
  },
34
34
  timeout=720.0 # 12 minute timeout for deep research operations
@@ -552,15 +552,23 @@ class NIAApiClient:
552
552
  for repo in repositories:
553
553
  repo_list.append({"repository": repo})
554
554
 
555
- # Build data source list
555
+ # Build data source list
556
556
  source_list = []
557
557
  if data_sources:
558
- for source_id in data_sources:
559
- # Handle both list of IDs and list of dicts
560
- if isinstance(source_id, dict):
561
- source_list.append(source_id)
558
+ for source in data_sources:
559
+ # Handle flexible identifier formats:
560
+ # 1. String directly (display_name, URL, or source_id) - NEW
561
+ # 2. Dict with "source_id" (backwards compatible)
562
+ # 3. Dict with "identifier" (new format)
563
+ if isinstance(source, str):
564
+ # Pass string directly - backend will resolve it
565
+ source_list.append(source)
566
+ elif isinstance(source, dict):
567
+ # Keep dict format as-is (backwards compatible)
568
+ source_list.append(source)
562
569
  else:
563
- source_list.append({"source_id": source_id})
570
+ # Convert other types to string
571
+ source_list.append(str(source))
564
572
 
565
573
  # Validate at least one source
566
574
  if not repo_list and not source_list:
nia_mcp_server/server.py CHANGED
@@ -186,34 +186,22 @@ async def search_codebase(
186
186
  try:
187
187
  client = await ensure_api_client()
188
188
 
189
- # Get all indexed repositories if not specified
189
+ # Require explicit repository selection
190
190
  if not repositories:
191
- all_repos = await client.list_repositories()
192
-
193
- # Ensure all_repos is a list and contains dictionaries
194
- if not isinstance(all_repos, list):
195
- logger.error(f"Unexpected type for all_repos: {type(all_repos)}")
196
- return [TextContent(
197
- type="text",
198
- text=" Error retrieving repositories. The API returned an unexpected response."
199
- )]
200
-
201
- repositories = []
202
- for repo in all_repos:
203
- if isinstance(repo, dict) and repo.get("status") == "completed":
204
- repo_name = repo.get("repository")
205
- if repo_name:
206
- repositories.append(repo_name)
207
- else:
208
- logger.warning(f"Repository missing 'repository' field: {repo}")
209
- else:
210
- logger.warning(f"Unexpected repository format: {type(repo)}, value: {repo}")
211
-
212
- if not repositories:
213
- return [TextContent(
214
- type="text",
215
- text="❌ No indexed repositories found. Use `index_repository` to index a codebase first."
216
- )]
191
+ return [TextContent(
192
+ type="text",
193
+ text="🔍 **Please specify which repositories to search:**\n\n"
194
+ "1. Use `list_repositories` to see available repositories\n"
195
+ "2. Then call `search_codebase(\"your query\", [\"owner/repo1\", \"owner/repo2\"])`\n\n"
196
+ "**Example:**\n"
197
+ "```\n"
198
+ "search_codebase(\"How does auth work?\", [\"facebook/react\"])\n"
199
+ "```\n\n"
200
+ "**📌 Tip:** You can search specific folders using the exact format from `list_repositories`:\n"
201
+ "```\n"
202
+ "search_codebase(\"query\", [\"owner/repo/tree/branch/folder\"])\n"
203
+ "```"
204
+ )]
217
205
 
218
206
  # Build messages for the query
219
207
  messages = [
@@ -343,31 +331,46 @@ async def search_documentation(
343
331
  include_sources: bool = True
344
332
  ) -> List[TextContent]:
345
333
  """
346
- Search indexed documentation using natural language.
347
-
334
+ Search indexed documentation using natural language.
335
+
348
336
  Args:
349
337
  query: Natural language search query. Don't just use keywords or unstrctured query, make a comprehensive question to get the best results possible.
350
- sources: List of documentation source IDs to search. Use it based on user's query.
338
+ sources: List of documentation identifiers to search. Can be:
339
+ - Display names (e.g., "Vercel AI SDK - Core")
340
+ - URLs (e.g., "https://sdk.vercel.ai/docs")
341
+ - Source IDs (UUID format for backwards compatibility)
351
342
  include_sources: Whether to include source references in results
352
-
343
+
353
344
  Returns:
354
345
  Search results with relevant documentation excerpts
355
346
 
356
347
  Important:
357
- - Always use Source ID. If you don't have it, use `list_documentation` tool to get it.
348
+ - You can now use friendly names instead of UUIDs! Try display names or URLs.
349
+ - If you don't know the identifiers, use `list_documentation` tool to see available options.
358
350
  """
359
351
  try:
360
352
  client = await ensure_api_client()
361
353
 
362
- # Get all indexed documentation sources if not specified
354
+ # Require explicit source selection
363
355
  if not sources:
364
- all_sources = await client.list_data_sources()
365
- sources = [source["id"] for source in all_sources if source.get("status") == "completed"]
366
- if not sources:
367
- return [TextContent(
368
- type="text",
369
- text=" No indexed documentation found. Use `index_documentation` to index documentation first."
370
- )]
356
+ return [TextContent(
357
+ type="text",
358
+ text="📚 **Please specify which documentation sources to search:**\n\n"
359
+ "1. Use `list_documentation` to see available sources\n"
360
+ "2. Then call `search_documentation(\"your query\", [\"source1\", \"source2\"])`\n\n"
361
+ "**You can use any of these identifier formats:**\n"
362
+ "- Display names: `\"Vercel AI SDK - Core\"`\n"
363
+ "- URLs: `\"https://docs.trynia.ai/\"`\n"
364
+ "- UUIDs: `\"550e8400-e29b-41d4-a716-446655440000\"`\n\n"
365
+ "**Example:**\n"
366
+ "```\n"
367
+ "search_documentation(\"API reference\", [\"Vercel AI SDK - Core\"])\n"
368
+ "```\n\n"
369
+ "**📌 Tip:** Mix different identifier types in the same search:\n"
370
+ "```\n"
371
+ "search_documentation(\"query\", [\"Display Name\", \"https://docs.example.com/\"])\n"
372
+ "```"
373
+ )]
371
374
 
372
375
  # Build messages for the query
373
376
  messages = [
@@ -844,7 +847,7 @@ async def rename_resource(
844
847
  resource_type: Type of resource - "repository" or "documentation"
845
848
  identifier:
846
849
  - For repository: Repository in owner/repo format (e.g., "facebook/react")
847
- - For documentation: Documentation source ID
850
+ - For documentation: Can be display name, URL, or UUID (e.g., "Vercel AI SDK - Core", "https://docs.trynia.ai/", or "doc-id-123")
848
851
  new_name: New display name for the resource (1-100 characters)
849
852
 
850
853
  Returns:
@@ -852,7 +855,8 @@ async def rename_resource(
852
855
 
853
856
  Examples:
854
857
  - rename_resource("repository", "facebook/react", "React Framework")
855
- - rename_resource("documentation", "doc-id-123", "Python Official Docs")
858
+ - rename_resource("documentation", "Vercel AI SDK - Core", "Python Official Docs")
859
+ - rename_resource("documentation", "https://docs.trynia.ai/", "NIA Documentation")
856
860
  """
857
861
  try:
858
862
  # Validate resource type
@@ -914,14 +918,15 @@ async def delete_resource(
914
918
  resource_type: Type of resource - "repository" or "documentation"
915
919
  identifier:
916
920
  - For repository: Repository in owner/repo format (e.g., "facebook/react")
917
- - For documentation: Documentation source ID
921
+ - For documentation: Can be display name, URL, or UUID (e.g., "Vercel AI SDK - Core", "https://docs.trynia.ai/", or "doc-id-123")
918
922
 
919
923
  Returns:
920
924
  Confirmation of deletion
921
925
 
922
926
  Examples:
923
927
  - delete_resource("repository", "facebook/react")
924
- - delete_resource("documentation", "doc-id-123")
928
+ - delete_resource("documentation", "Vercel AI SDK - Core")
929
+ - delete_resource("documentation", "https://docs.trynia.ai/")
925
930
  """
926
931
  try:
927
932
  # Validate resource type
@@ -976,14 +981,18 @@ async def check_resource_status(
976
981
  resource_type: Type of resource - "repository" or "documentation"
977
982
  identifier:
978
983
  - For repository: Repository in owner/repo format (e.g., "facebook/react")
979
- - For documentation: Documentation source ID
984
+ - For documentation: Source ID (UUID format only) - use list_resources to get the UUID
980
985
 
981
986
  Returns:
982
987
  Current status of the resource
983
988
 
984
989
  Examples:
985
990
  - check_resource_status("repository", "facebook/react")
986
- - check_resource_status("documentation", "doc-id-123")
991
+ - check_resource_status("documentation", "550e8400-e29b-41d4-a716-446655440000")
992
+
993
+ Note:
994
+ - Documentation status checking requires UUID identifiers only
995
+ - Use list_resources("documentation") to find the UUID for a documentation source
987
996
  """
988
997
  try:
989
998
  # Validate resource type
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nia-mcp-server
3
- Version: 1.0.19
3
+ Version: 1.0.20
4
4
  Summary: Nia Knowledge Agent
5
5
  Project-URL: Homepage, https://trynia.ai
6
6
  Project-URL: Documentation, https://docs.trynia.ai
@@ -1,19 +1,19 @@
1
- nia_mcp_server/__init__.py,sha256=pSWbf7f_Szm7PGv59EVlQ2OhXRKG7yy39pD01-DZ9pQ,85
1
+ nia_mcp_server/__init__.py,sha256=43Fw4mFrmz39fC_Bm1vMdF7Cl78hJiEJskqhB1WfLiA,85
2
2
  nia_mcp_server/__main__.py,sha256=YQSpFtDeKp18r8mKr084cHnRFV4416_EKCu9FTM8_ik,394
3
- nia_mcp_server/api_client.py,sha256=tXxRMs1tHC4YaOs63xhfobo58tWnMo9VULSojQWQLQs,34549
3
+ nia_mcp_server/api_client.py,sha256=U5gARDC2p0-MUUDPCLmDtRgRSl-kRNwhDHXWE0n0dgU,35034
4
4
  nia_mcp_server/cli.py,sha256=32VSPNIocXtDgVBDZNZsxvj3kytBn54_a1pIE84vOdY,1834
5
5
  nia_mcp_server/profiles.py,sha256=2DD8PFRr5Ij4IK4sPUz0mH8aKjkrEtkKLC1R0iki2bA,7221
6
6
  nia_mcp_server/project_init.py,sha256=T0-ziJhofL4L8APwnM43BLhxtlmOHaYH-V9PF2yXLw4,7138
7
7
  nia_mcp_server/rule_transformer.py,sha256=wCxoQ1Kl_rI9mUFnh9kG5iCXYU4QInrmFQOReZfAFVo,11000
8
- nia_mcp_server/server.py,sha256=kPUxhLlG4TYMeYbcNO6WRRYDinXFdIKPnt_MIbUJTu4,129525
8
+ nia_mcp_server/server.py,sha256=x5RTZ2Yc8VLL2Jeule_hA7o2EEvp7zl5UHLraDWseg4,130570
9
9
  nia_mcp_server/setup.py,sha256=nJXVY8NHGtWROtoH8DW-3uOgyuPs4F9dW0cNhcbCLrM,5355
10
10
  nia_mcp_server/assets/rules/claude_rules.md,sha256=HNL5GJMUbFxSpNbIAJUQWqAywjMl4lf530I1in69aNY,7380
11
11
  nia_mcp_server/assets/rules/cursor_rules.md,sha256=hd6lhzNrK1ULQUYIEVeOnyKnuLKq4hmwZPbMqGUI1Lk,1720
12
12
  nia_mcp_server/assets/rules/nia_rules.md,sha256=l6sx000uqoczoHYqOPp4hnNgyfpnhvO9NyT0fVx5nU0,8059
13
13
  nia_mcp_server/assets/rules/vscode_rules.md,sha256=fqn4aJO_bhftaCGkVoquruQHf3EaREQJQWHXq6a4FOk,6967
14
14
  nia_mcp_server/assets/rules/windsurf_rules.md,sha256=PzU2as5gaiVsV6PAzg8T_-GR7VCyRQGMjAHcSzYF_ms,3354
15
- nia_mcp_server-1.0.19.dist-info/METADATA,sha256=efXnlGvpmf8kAjf9qgJRlPIzn0QCTIKMvJUN_GAFh-g,1324
16
- nia_mcp_server-1.0.19.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
- nia_mcp_server-1.0.19.dist-info/entry_points.txt,sha256=V74FQEp48pfWxPCl7B9mihtqvIJNVjCSbRfCz4ww77I,64
18
- nia_mcp_server-1.0.19.dist-info/licenses/LICENSE,sha256=IrdVKi3bsiB2MTLM26MltBRpwyNi-8P6Cy0EnmAN76A,1557
19
- nia_mcp_server-1.0.19.dist-info/RECORD,,
15
+ nia_mcp_server-1.0.20.dist-info/METADATA,sha256=-akLTFU4GDQE-PpDSvfUYN7l8Va6By8KiZqkq371HYg,1324
16
+ nia_mcp_server-1.0.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ nia_mcp_server-1.0.20.dist-info/entry_points.txt,sha256=V74FQEp48pfWxPCl7B9mihtqvIJNVjCSbRfCz4ww77I,64
18
+ nia_mcp_server-1.0.20.dist-info/licenses/LICENSE,sha256=IrdVKi3bsiB2MTLM26MltBRpwyNi-8P6Cy0EnmAN76A,1557
19
+ nia_mcp_server-1.0.20.dist-info/RECORD,,