nia-mcp-server 1.0.12__py3-none-any.whl → 1.0.14__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.12"
5
+ __version__ = "1.0.13"
@@ -1,11 +1,21 @@
1
1
  """
2
2
  Entry point for NIA MCP Server
3
3
  """
4
+ import sys
4
5
  from .server import run
6
+ from .cli import main as cli_main
7
+
5
8
 
6
9
  def main():
7
10
  """Main entry point."""
8
- run()
11
+ # Check if running as CLI command
12
+ if len(sys.argv) > 1 and sys.argv[1] in ["setup", "--help", "-h"]:
13
+ # Run CLI interface
14
+ cli_main()
15
+ else:
16
+ # Run MCP server
17
+ run()
18
+
9
19
 
10
20
  if __name__ == "__main__":
11
21
  main()
@@ -75,7 +75,7 @@ class NIAApiClient:
75
75
  "lifetime limit",
76
76
  "no chat credits",
77
77
  "free api requests",
78
- "5 free",
78
+ "3 free",
79
79
  "usage limit",
80
80
  ]
81
81
  ):
@@ -99,7 +99,7 @@ class NIAApiClient:
99
99
  for phrase in [
100
100
  "lifetime limit",
101
101
  "free api requests",
102
- "5 free",
102
+ "3 free",
103
103
  "usage limit",
104
104
  ]
105
105
  ):
@@ -36,7 +36,7 @@ Note: Nia is just "Nia" - not an acronym. It's the name of the knowledge search
36
36
  - **Leverage repository context** - Specify repositories when searching indexed codebases
37
37
 
38
38
  ### 4. API Usage Best Practices
39
- - **Handle rate limits gracefully** - Free tier has 25 API request limit
39
+ - **Handle rate limits gracefully** - Free tier has 3 indexing operations limit
40
40
  - **Cache results mentally** - Avoid redundant searches in the same conversation
41
41
  - **Batch operations** - Index multiple related repositories together
42
42
  - **Monitor status efficiently** - Check status periodically, not continuously
nia_mcp_server/cli.py ADDED
@@ -0,0 +1,69 @@
1
+ """
2
+ CLI interface for NIA MCP Server
3
+ """
4
+ import sys
5
+ import argparse
6
+ from typing import Optional
7
+ from .setup import setup_mcp_config
8
+
9
+
10
+ def validate_api_key(api_key: str) -> bool:
11
+ """Validate API key format."""
12
+ if not api_key:
13
+ return False
14
+ # Check if it starts with the expected prefix
15
+ if not api_key.startswith("nk_"):
16
+ return False
17
+ # Check minimum length (prefix + reasonable key length)
18
+ if len(api_key) < 10:
19
+ return False
20
+ return True
21
+
22
+
23
+ def main():
24
+ """Main CLI entry point."""
25
+ parser = argparse.ArgumentParser(
26
+ description="NIA MCP Server - AI-powered code search",
27
+ prog="nia-mcp-server"
28
+ )
29
+
30
+ subparsers = parser.add_subparsers(dest="command", help="Available commands")
31
+
32
+ # Setup command
33
+ setup_parser = subparsers.add_parser(
34
+ "setup",
35
+ help="Set up NIA MCP Server for your IDE"
36
+ )
37
+ setup_parser.add_argument(
38
+ "api_key",
39
+ help="Your NIA API key (get it from https://app.trynia.ai/api-keys)"
40
+ )
41
+ setup_parser.add_argument(
42
+ "--ide",
43
+ choices=["cursor", "vscode", "continue"],
44
+ default="cursor",
45
+ help="IDE to configure (default: cursor)"
46
+ )
47
+
48
+ # Parse arguments
49
+ args = parser.parse_args()
50
+
51
+ # Handle commands
52
+ if args.command == "setup":
53
+ # Validate API key
54
+ if not validate_api_key(args.api_key):
55
+ print("❌ Invalid API key format. API key should start with 'nk_'")
56
+ print(" Get your API key from: https://app.trynia.ai/api-keys")
57
+ sys.exit(1)
58
+
59
+ # Run setup
60
+ success = setup_mcp_config(args.api_key, args.ide)
61
+ sys.exit(0 if success else 1)
62
+
63
+ # If no command specified, show help
64
+ parser.print_help()
65
+ sys.exit(1)
66
+
67
+
68
+ if __name__ == "__main__":
69
+ main()
nia_mcp_server/server.py CHANGED
@@ -121,11 +121,11 @@ async def index_repository(
121
121
 
122
122
  except APIError as e:
123
123
  logger.error(f"API Error indexing repository: {e} (status_code={e.status_code}, detail={e.detail})")
124
- if e.status_code == 403 or "free tier limit" in str(e).lower() or "free api requests" in str(e).lower():
125
- if e.detail and "5 free API requests" in e.detail:
124
+ if e.status_code == 403 or "free tier limit" in str(e).lower() or "indexing operations" in str(e).lower():
125
+ if e.detail and "3 free indexing operations" in e.detail:
126
126
  return [TextContent(
127
127
  type="text",
128
- text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
128
+ text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
129
129
  )]
130
130
  else:
131
131
  return [TextContent(
@@ -137,10 +137,10 @@ async def index_repository(
137
137
  except Exception as e:
138
138
  logger.error(f"Unexpected error indexing repository: {e}")
139
139
  error_msg = str(e)
140
- if "free api requests" in error_msg.lower() or "lifetime limit" in error_msg.lower():
140
+ if "indexing operations" in error_msg.lower() or "lifetime limit" in error_msg.lower():
141
141
  return [TextContent(
142
142
  type="text",
143
- text=f"❌ {error_msg}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
143
+ text=f"❌ {error_msg}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
144
144
  )]
145
145
  return [TextContent(
146
146
  type="text",
@@ -279,11 +279,11 @@ async def search_codebase(
279
279
 
280
280
  except APIError as e:
281
281
  logger.error(f"API Error searching codebase: {e} (status_code={e.status_code}, detail={e.detail})")
282
- if e.status_code == 403 or "free tier limit" in str(e).lower() or "free api requests" in str(e).lower():
283
- if e.detail and "5 free API requests" in e.detail:
282
+ if e.status_code == 403 or "free tier limit" in str(e).lower() or "indexing operations" in str(e).lower():
283
+ if e.detail and "3 free indexing operations" in e.detail:
284
284
  return [TextContent(
285
285
  type="text",
286
- text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
286
+ text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
287
287
  )]
288
288
  else:
289
289
  return [TextContent(
@@ -295,10 +295,10 @@ async def search_codebase(
295
295
  except Exception as e:
296
296
  logger.error(f"Unexpected error searching codebase: {e}")
297
297
  error_msg = str(e)
298
- if "free api requests" in error_msg.lower() or "lifetime limit" in error_msg.lower():
298
+ if "indexing operations" in error_msg.lower() or "lifetime limit" in error_msg.lower():
299
299
  return [TextContent(
300
300
  type="text",
301
- text=f"❌ {error_msg}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
301
+ text=f"❌ {error_msg}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
302
302
  )]
303
303
  return [TextContent(
304
304
  type="text",
@@ -419,7 +419,7 @@ async def search_documentation(
419
419
  logger.error(f"API Error searching documentation: {e}")
420
420
  error_msg = f"❌ {str(e)}"
421
421
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
422
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
422
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
423
423
  return [TextContent(type="text", text=error_msg)]
424
424
  except Exception as e:
425
425
  logger.error(f"Error searching documentation: {e}")
@@ -476,12 +476,12 @@ async def list_repositories() -> List[TextContent]:
476
476
  except APIError as e:
477
477
  logger.error(f"API Error listing repositories: {e} (status_code={e.status_code}, detail={e.detail})")
478
478
  # Check for free tier limit errors
479
- if e.status_code == 403 or "free tier limit" in str(e).lower() or "free api requests" in str(e).lower():
479
+ if e.status_code == 403 or "free tier limit" in str(e).lower() or "indexing operations" in str(e).lower():
480
480
  # Extract the specific limit message
481
- if e.detail and "5 free API requests" in e.detail:
481
+ if e.detail and "3 free indexing operations" in e.detail:
482
482
  return [TextContent(
483
483
  type="text",
484
- text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
484
+ text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
485
485
  )]
486
486
  else:
487
487
  return [TextContent(
@@ -494,10 +494,10 @@ async def list_repositories() -> List[TextContent]:
494
494
  logger.error(f"Unexpected error listing repositories (type={type(e).__name__}): {e}")
495
495
  # Check if this looks like an API limit error that wasn't caught properly
496
496
  error_msg = str(e)
497
- if "free api requests" in error_msg.lower() or "lifetime limit" in error_msg.lower():
497
+ if "indexing operations" in error_msg.lower() or "lifetime limit" in error_msg.lower():
498
498
  return [TextContent(
499
499
  type="text",
500
- text=f"❌ {error_msg}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
500
+ text=f"❌ {error_msg}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
501
501
  )]
502
502
  return [TextContent(
503
503
  type="text",
@@ -558,7 +558,7 @@ async def check_repository_status(repository: str) -> List[TextContent]:
558
558
  logger.error(f"API Error checking repository status: {e}")
559
559
  error_msg = f"❌ {str(e)}"
560
560
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
561
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
561
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
562
562
  return [TextContent(type="text", text=error_msg)]
563
563
  except Exception as e:
564
564
  logger.error(f"Error checking repository status: {e}")
@@ -645,7 +645,7 @@ async def index_documentation(
645
645
  logger.error(f"API Error indexing documentation: {e}")
646
646
  error_msg = f"❌ {str(e)}"
647
647
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
648
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
648
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
649
649
  return [TextContent(type="text", text=error_msg)]
650
650
  except Exception as e:
651
651
  logger.error(f"Error indexing documentation: {e}")
@@ -704,7 +704,7 @@ async def list_documentation() -> List[TextContent]:
704
704
  logger.error(f"API Error listing documentation: {e}")
705
705
  error_msg = f"❌ {str(e)}"
706
706
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
707
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
707
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
708
708
  return [TextContent(type="text", text=error_msg)]
709
709
  except Exception as e:
710
710
  logger.error(f"Error listing documentation: {e}")
@@ -770,7 +770,7 @@ async def check_documentation_status(source_id: str) -> List[TextContent]:
770
770
  logger.error(f"API Error checking documentation status: {e}")
771
771
  error_msg = f"❌ {str(e)}"
772
772
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
773
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
773
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
774
774
  return [TextContent(type="text", text=error_msg)]
775
775
  except Exception as e:
776
776
  logger.error(f"Error checking documentation status: {e}")
@@ -809,7 +809,7 @@ async def delete_documentation(source_id: str) -> List[TextContent]:
809
809
  logger.error(f"API Error deleting documentation: {e}")
810
810
  error_msg = f"❌ {str(e)}"
811
811
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
812
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
812
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
813
813
  return [TextContent(type="text", text=error_msg)]
814
814
  except Exception as e:
815
815
  logger.error(f"Error deleting documentation: {e}")
@@ -848,7 +848,7 @@ async def delete_repository(repository: str) -> List[TextContent]:
848
848
  logger.error(f"API Error deleting repository: {e}")
849
849
  error_msg = f"❌ {str(e)}"
850
850
  if e.status_code == 403 and "lifetime limit" in str(e).lower():
851
- error_msg += "\n\n💡 Tip: You've reached the free tier limit of 5 API requests. Upgrade to Pro for unlimited access."
851
+ error_msg += "\n\n💡 Tip: You've reached the free tier limit of 3 indexing operations. Upgrade to Pro for unlimited access."
852
852
  return [TextContent(type="text", text=error_msg)]
853
853
  except Exception as e:
854
854
  logger.error(f"Error deleting repository: {e}")
@@ -1099,11 +1099,11 @@ async def nia_web_search(
1099
1099
 
1100
1100
  except APIError as e:
1101
1101
  logger.error(f"API Error in web search: {e}")
1102
- if e.status_code == 403 or "free tier limit" in str(e).lower() or "free api requests" in str(e).lower():
1103
- if e.detail and "5 free API requests" in e.detail:
1102
+ if e.status_code == 403 or "free tier limit" in str(e).lower() or "indexing operations" in str(e).lower():
1103
+ if e.detail and "3 free indexing operations" in e.detail:
1104
1104
  return [TextContent(
1105
1105
  type="text",
1106
- text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
1106
+ text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
1107
1107
  )]
1108
1108
  else:
1109
1109
  return [TextContent(
@@ -1278,11 +1278,11 @@ async def nia_deep_research_agent(
1278
1278
 
1279
1279
  except APIError as e:
1280
1280
  logger.error(f"API Error in deep research: {e}")
1281
- if e.status_code == 403 or "free tier limit" in str(e).lower() or "free api requests" in str(e).lower():
1282
- if e.detail and "5 free API requests" in e.detail:
1281
+ if e.status_code == 403 or "free tier limit" in str(e).lower() or "indexing operations" in str(e).lower():
1282
+ if e.detail and "3 free indexing operations" in e.detail:
1283
1283
  return [TextContent(
1284
1284
  type="text",
1285
- text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited API access."
1285
+ text=f"❌ {e.detail}\n\n💡 Tip: Upgrade to Pro at https://trynia.ai/billing for unlimited indexing."
1286
1286
  )]
1287
1287
  else:
1288
1288
  return [TextContent(
@@ -0,0 +1,177 @@
1
+ """
2
+ Setup utilities for NIA MCP Server configuration
3
+ """
4
+ import os
5
+ import json
6
+ import platform
7
+ import shutil
8
+ from pathlib import Path
9
+ from typing import Dict, Optional, Any
10
+
11
+
12
+ def find_mcp_config_path(ide: str = "cursor") -> Path:
13
+ """
14
+ Find the MCP configuration file path based on OS and IDE.
15
+
16
+ Args:
17
+ ide: IDE to configure (cursor, vscode, continue)
18
+
19
+ Returns:
20
+ Path to the MCP configuration file
21
+ """
22
+ system = platform.system()
23
+ home = Path.home()
24
+
25
+ if ide == "cursor":
26
+ if system == "Darwin": # macOS
27
+ return home / ".cursor" / "mcp.json"
28
+ elif system == "Windows":
29
+ appdata = os.environ.get("APPDATA", home / "AppData" / "Roaming")
30
+ return Path(appdata) / "Cursor" / "mcp.json"
31
+ else: # Linux and others
32
+ return home / ".config" / "cursor" / "mcp.json"
33
+
34
+ elif ide == "vscode":
35
+ # VS Code uses different config locations
36
+ if system == "Darwin":
37
+ return home / "Library" / "Application Support" / "Code" / "User" / "mcp.json"
38
+ elif system == "Windows":
39
+ appdata = os.environ.get("APPDATA", home / "AppData" / "Roaming")
40
+ return Path(appdata) / "Code" / "User" / "mcp.json"
41
+ else:
42
+ return home / ".config" / "Code" / "User" / "mcp.json"
43
+
44
+ elif ide == "continue":
45
+ # Continue.dev uses .continue directory
46
+ return home / ".continue" / "config.json"
47
+
48
+ else:
49
+ raise ValueError(f"Unsupported IDE: {ide}")
50
+
51
+
52
+ def backup_config(config_path: Path) -> Optional[Path]:
53
+ """
54
+ Create a backup of existing configuration file.
55
+
56
+ Args:
57
+ config_path: Path to the configuration file
58
+
59
+ Returns:
60
+ Path to the backup file if created, None otherwise
61
+ """
62
+ if config_path.exists():
63
+ backup_path = config_path.with_suffix(".json.backup")
64
+ # If backup already exists, add timestamp
65
+ if backup_path.exists():
66
+ import time
67
+ timestamp = int(time.time())
68
+ backup_path = config_path.with_suffix(f".json.backup.{timestamp}")
69
+
70
+ shutil.copy2(config_path, backup_path)
71
+ return backup_path
72
+ return None
73
+
74
+
75
+ def create_nia_config(api_key: str) -> Dict[str, Any]:
76
+ """
77
+ Create NIA MCP server configuration.
78
+
79
+ Args:
80
+ api_key: NIA API key
81
+
82
+ Returns:
83
+ Dictionary with NIA server configuration
84
+ """
85
+ return {
86
+ "command": "pipx",
87
+ "args": ["run", "nia-mcp-server"],
88
+ "env": {
89
+ "NIA_API_KEY": api_key,
90
+ "NIA_API_URL": "https://apigcp.trynia.ai/"
91
+ }
92
+ }
93
+
94
+
95
+ def update_mcp_config(config_path: Path, api_key: str) -> bool:
96
+ """
97
+ Update or create MCP configuration file with NIA server.
98
+
99
+ Args:
100
+ config_path: Path to the MCP configuration file
101
+ api_key: NIA API key
102
+
103
+ Returns:
104
+ True if successful, False otherwise
105
+ """
106
+ try:
107
+ # Ensure directory exists
108
+ config_path.parent.mkdir(parents=True, exist_ok=True)
109
+
110
+ # Load existing config or create new one
111
+ if config_path.exists():
112
+ with open(config_path, 'r') as f:
113
+ config = json.load(f)
114
+ else:
115
+ config = {}
116
+
117
+ # Ensure mcpServers section exists
118
+ if "mcpServers" not in config:
119
+ config["mcpServers"] = {}
120
+
121
+ # Add or update NIA server configuration
122
+ config["mcpServers"]["nia"] = create_nia_config(api_key)
123
+
124
+ # Write updated configuration
125
+ with open(config_path, 'w') as f:
126
+ json.dump(config, f, indent=2)
127
+
128
+ return True
129
+
130
+ except Exception as e:
131
+ print(f"❌ Error updating configuration: {e}")
132
+ return False
133
+
134
+
135
+ def setup_mcp_config(api_key: str, ide: str = "cursor") -> bool:
136
+ """
137
+ Main setup function to configure NIA MCP Server.
138
+
139
+ Args:
140
+ api_key: NIA API key
141
+ ide: IDE to configure
142
+
143
+ Returns:
144
+ True if successful, False otherwise
145
+ """
146
+ print(f"\n🚀 Setting up NIA MCP Server for {ide.title()}...\n")
147
+
148
+ # Find config path
149
+ config_path = find_mcp_config_path(ide)
150
+ print(f"📍 Configuration path: {config_path}")
151
+
152
+ # Backup existing config
153
+ backup_path = backup_config(config_path)
154
+ if backup_path:
155
+ print(f"📦 Backed up existing config to: {backup_path}")
156
+
157
+ # Update configuration
158
+ if update_mcp_config(config_path, api_key):
159
+ print(f"\n✅ NIA MCP Server setup complete!")
160
+ print(f"\n📝 Configuration written to: {config_path}")
161
+ print(f"🔑 API Key: {api_key[:10]}...")
162
+
163
+ print("\n📌 Next steps:")
164
+ print(f" 1. Restart {ide.title()} to load the NIA MCP server")
165
+ print(f" 2. Test with: \"Claude, list my repositories\"")
166
+ print(f" 3. Get started: \"Claude, index https://github.com/owner/repo\"")
167
+
168
+ print("\n💡 Learn more:")
169
+ print(" - Documentation: https://docs.trynia.ai")
170
+ print(" - Get help: https://discord.gg/BBSwUMrrfn")
171
+
172
+ return True
173
+ else:
174
+ print(f"\n❌ Setup failed. Please check the error messages above.")
175
+ if backup_path:
176
+ print(f" Your original config is safe at: {backup_path}")
177
+ return False
@@ -0,0 +1,39 @@
1
+ Metadata-Version: 2.4
2
+ Name: nia-mcp-server
3
+ Version: 1.0.14
4
+ Summary: Nia Knowledge Agent
5
+ Project-URL: Homepage, https://trynia.ai
6
+ Project-URL: Documentation, https://docs.trynia.ai
7
+ Author-email: Nia Team <founders@nozomio.com>
8
+ License-Expression: AGPL-3.0
9
+ License-File: LICENSE
10
+ Keywords: ai,codebase,mcp,nia,search
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Requires-Python: >=3.8
21
+ Requires-Dist: httpx>=0.24.0
22
+ Requires-Dist: mcp>=0.1.0
23
+ Requires-Dist: pydantic>=2.0.0
24
+ Requires-Dist: python-dotenv>=1.0.0
25
+ Description-Content-Type: text/markdown
26
+
27
+ # NIA MCP Server
28
+
29
+ The NIA MCP Server enables AI assistants like Claude to search and understand your indexed codebases through the Model Context Protocol (MCP).
30
+
31
+ ## Quick Start
32
+
33
+ ### Automatic Setup (Recommended) ✨
34
+
35
+ Get your API key from [https://trynia.ai/api-keys](https://trynia.ai/api-keys) and run:
36
+
37
+ ```bash
38
+ pipx run nia-mcp-server setup YOUR_API_KEY
39
+ ```
@@ -0,0 +1,19 @@
1
+ nia_mcp_server/__init__.py,sha256=meeT4feLJfGvMAng90TkSl96ykJI_siO0HtnR-5RR5w,85
2
+ nia_mcp_server/__main__.py,sha256=YQSpFtDeKp18r8mKr084cHnRFV4416_EKCu9FTM8_ik,394
3
+ nia_mcp_server/api_client.py,sha256=-wSOyL1I9MVCQR2cE1NRXyqB3ZjtnNn8d6sLRhFoSyA,25815
4
+ nia_mcp_server/cli.py,sha256=32VSPNIocXtDgVBDZNZsxvj3kytBn54_a1pIE84vOdY,1834
5
+ nia_mcp_server/profiles.py,sha256=2DD8PFRr5Ij4IK4sPUz0mH8aKjkrEtkKLC1R0iki2bA,7221
6
+ nia_mcp_server/project_init.py,sha256=T0-ziJhofL4L8APwnM43BLhxtlmOHaYH-V9PF2yXLw4,7138
7
+ nia_mcp_server/rule_transformer.py,sha256=wCxoQ1Kl_rI9mUFnh9kG5iCXYU4QInrmFQOReZfAFVo,11000
8
+ nia_mcp_server/server.py,sha256=ZZ46Q_mf3BlqpQ4_sZPUSH18PcEDmhE0c_mgocr7Mmk,75911
9
+ nia_mcp_server/setup.py,sha256=nJXVY8NHGtWROtoH8DW-3uOgyuPs4F9dW0cNhcbCLrM,5355
10
+ nia_mcp_server/assets/rules/claude_rules.md,sha256=HNL5GJMUbFxSpNbIAJUQWqAywjMl4lf530I1in69aNY,7380
11
+ nia_mcp_server/assets/rules/cursor_rules.md,sha256=hd6lhzNrK1ULQUYIEVeOnyKnuLKq4hmwZPbMqGUI1Lk,1720
12
+ nia_mcp_server/assets/rules/nia_rules.md,sha256=9j47OkNivwFwARxiCUF6o2RIVaPqFzInYw8tnhKYwE0,6352
13
+ nia_mcp_server/assets/rules/vscode_rules.md,sha256=fqn4aJO_bhftaCGkVoquruQHf3EaREQJQWHXq6a4FOk,6967
14
+ nia_mcp_server/assets/rules/windsurf_rules.md,sha256=PzU2as5gaiVsV6PAzg8T_-GR7VCyRQGMjAHcSzYF_ms,3354
15
+ nia_mcp_server-1.0.14.dist-info/METADATA,sha256=Y6PwQIZ2NMFQb8JHFH-Oor9HyGcO0SruF-ypy58GSZ8,1324
16
+ nia_mcp_server-1.0.14.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
17
+ nia_mcp_server-1.0.14.dist-info/entry_points.txt,sha256=V74FQEp48pfWxPCl7B9mihtqvIJNVjCSbRfCz4ww77I,64
18
+ nia_mcp_server-1.0.14.dist-info/licenses/LICENSE,sha256=IrdVKi3bsiB2MTLM26MltBRpwyNi-8P6Cy0EnmAN76A,1557
19
+ nia_mcp_server-1.0.14.dist-info/RECORD,,
@@ -1,246 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: nia-mcp-server
3
- Version: 1.0.12
4
- Summary: Nia Knowledge Agent
5
- Project-URL: Homepage, https://trynia.ai
6
- Project-URL: Documentation, https://docs.trynia.ai
7
- Author-email: Nia Team <founders@nozomio.com>
8
- License-Expression: AGPL-3.0
9
- License-File: LICENSE
10
- Keywords: ai,codebase,mcp,nia,search
11
- Classifier: Development Status :: 4 - Beta
12
- Classifier: Intended Audience :: Developers
13
- Classifier: License :: OSI Approved :: GNU Affero General Public License v3
14
- Classifier: Programming Language :: Python :: 3
15
- Classifier: Programming Language :: Python :: 3.8
16
- Classifier: Programming Language :: Python :: 3.9
17
- Classifier: Programming Language :: Python :: 3.10
18
- Classifier: Programming Language :: Python :: 3.11
19
- Classifier: Programming Language :: Python :: 3.12
20
- Requires-Python: >=3.8
21
- Requires-Dist: httpx>=0.24.0
22
- Requires-Dist: mcp>=0.1.0
23
- Requires-Dist: pydantic>=2.0.0
24
- Requires-Dist: python-dotenv>=1.0.0
25
- Description-Content-Type: text/markdown
26
-
27
- # NIA MCP Server
28
-
29
- The NIA MCP Server enables AI assistants like Claude to search and understand your indexed codebases through the Model Context Protocol (MCP).
30
-
31
- ## Quick Start
32
-
33
- ### 1. Get your NIA API Key
34
-
35
- Sign up and get your API key at [https://trynia.ai/api-keys](https://trynia.ai/api-keys)
36
-
37
- ### 2. Install via pip
38
-
39
- ```bash
40
- pip install nia-mcp-server
41
- ```
42
-
43
- ### 3. Configure with Claude Desktop
44
-
45
- Add to your Claude Desktop configuration (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
46
-
47
- ```json
48
- {
49
- "mcpServers": {
50
- "nia": {
51
- "command": "nia-mcp-server",
52
- "env": {
53
- "NIA_API_KEY": "your-api-key-here"
54
- }
55
- }
56
- }
57
- }
58
- ```
59
-
60
- ### 4. Restart Claude Desktop
61
-
62
- That's it! You can now ask Claude to index and search codebases.
63
-
64
- ## Usage Examples
65
-
66
- ### Index a repository
67
- ```
68
- Claude, please index https://github.com/facebook/react
69
- ```
70
-
71
- ### Index documentation
72
- ```
73
- Index the documentation at https://docs.python.org
74
- ```
75
-
76
- ### Search across everything
77
- ```
78
- How does async/await work? Search both my code and documentation.
79
- ```
80
-
81
- ### Search only repositories
82
- ```
83
- Find the authentication logic in my repositories
84
- ```
85
-
86
- ### Search only documentation
87
- ```
88
- What are the best practices for error handling according to the docs?
89
- ```
90
-
91
- ### Search and index new content
92
- ```
93
- Find the best RAG implementations out there
94
- ```
95
- Claude will:
96
- 1. Use the `nia_web_search` tool to find trending RAG repos
97
- 2. Show you the results with summaries
98
- 3. Prompt you to index the ones you want
99
- 4. You say "Index the first two" and it indexes them!
100
-
101
- ```
102
- What are the hottest new Rust web frameworks this week?
103
- ```
104
- Claude searches trending repos and guides you through indexing them.
105
-
106
- Advanced search examples:
107
- ```
108
- Find GitHub repos similar to langchain/langchain
109
-
110
- Search for AI papers published in the last 30 days
111
-
112
- What are the trending machine learning frameworks this month?
113
- ```
114
-
115
- ### Deep research questions
116
- ```
117
- Compare the top 3 vector databases for RAG applications
118
-
119
- What are the pros and cons of different LLM orchestration frameworks?
120
-
121
- Research the latest developments in AI agent architectures
122
- ```
123
-
124
- ### List your resources
125
- ```
126
- Show me all my indexed repositories and documentation
127
- ```
128
-
129
- ## Available Tools
130
-
131
- ### Search & Research
132
- - **`nia_web_search`** - AI-powered search of repositories, documentation, and content
133
- - Finds trending GitHub repos, relevant documentation, and more
134
- - Returns structured results that guide you to index the best content
135
- - Advanced options:
136
- - `category`: Filter by type (github, company, research paper, news, etc.)
137
- - `days_back`: Find content from the last N days (great for trending)
138
- - `find_similar_to`: Search for content similar to a given URL
139
- - Built into NIA's advanced search capabilities
140
-
141
- - **`nia_deep_research_agent`** - Multi-step AI research for complex questions
142
- - Best for comparative analysis, comprehensive overviews
143
- - Returns structured data with citations
144
- - Examples: "Compare top RAG frameworks", "Analyze trends in AI safety"
145
-
146
- ### Repository Management
147
- - **`index_repository`** - Index a GitHub repository
148
- - **`list_repositories`** - List all indexed repositories
149
- - **`check_repository_status`** - Check repository indexing progress
150
- - **`delete_repository`** - Remove an indexed repository
151
-
152
- ### Documentation Management
153
- - **`index_documentation`** - Index documentation or any website
154
- - **`list_documentation`** - List all indexed documentation sources
155
- - **`check_documentation_status`** - Check documentation indexing progress
156
- - **`delete_documentation`** - Remove indexed documentation
157
-
158
- ### Unified Search
159
- - **`search_codebase`** - Search across repositories and/or documentation
160
- - `search_mode`: "repositories", "sources", or "unified" (default)
161
- - Automatically searches all indexed content if not specified
162
-
163
- ## Other MCP Clients
164
-
165
- ### Continue.dev
166
-
167
- Add to your `~/.continue/config.json`:
168
-
169
- ```json
170
- {
171
- "models": [...],
172
- "mcpServers": [
173
- {
174
- "name": "nia",
175
- "command": "nia-mcp-server",
176
- "env": {
177
- "NIA_API_KEY": "your-api-key-here"
178
- }
179
- }
180
- ]
181
- }
182
- ```
183
-
184
- ### VS Code Cline
185
-
186
- Add to your Cline settings:
187
-
188
- ```json
189
- {
190
- "mcpServers": {
191
- "nia": {
192
- "command": "nia-mcp-server",
193
- "env": {
194
- "NIA_API_KEY": "your-api-key-here"
195
- }
196
- }
197
- }
198
- }
199
- ```
200
-
201
- ## Environment Variables
202
-
203
- - `NIA_API_KEY` (required) - Your NIA API key
204
- - `NIA_API_URL` (optional) - API endpoint (defaults to https://apigcp.trynia.ai)
205
-
206
- ## Pricing
207
-
208
- NIA offers simple, transparent pricing:
209
-
210
- - **Free Tier**: Limited usage, public repos only
211
- - **Pro**: Unlimited API calls, private repos, advanced features
212
-
213
- See [https://trynia.ai/pricing](https://trynia.ai/pricing) for details.
214
-
215
- ## Features
216
-
217
- - 🔍 **Unified Search** - Search across code AND documentation seamlessly
218
- - 📚 **Documentation Indexing** - Index any website or documentation
219
- - 🚀 **Fast Indexing** - Index repositories and websites quickly
220
- - 🔒 **Private Repos** - Support for private repositories (Pro)
221
- - 📊 **Smart Understanding** - AI-powered code and content comprehension
222
- - 🌐 **Works Everywhere** - Any MCP-compatible client
223
-
224
- ## Troubleshooting
225
-
226
- ### "No API key provided"
227
- Make sure `NIA_API_KEY` is set in your MCP client configuration.
228
-
229
- ### "Invalid API key"
230
- Check your API key at [https://trynia.ai/api-keys](https://trynia.ai/api-keys)
231
-
232
- ### "Rate limit exceeded"
233
- You've hit your monthly limit. Upgrade at [https://trynia.ai/billing](https://trynia.ai/billing)
234
-
235
- ### Repository not indexing
236
- Large repositories can take a few minutes. Use `check_repository_status` to monitor progress.
237
-
238
- ## Support
239
-
240
- - Documentation: [https://docs.trynia.ai](https://docs.trynia.ai)
241
- - Discord: [https://discord.gg/BBSwUMrrfn](https://discord.gg/BBSwUMrrfn)
242
- - Email: support@trynia.ai
243
-
244
- ## License
245
-
246
- MIT License - see LICENSE file for details.
@@ -1,17 +0,0 @@
1
- nia_mcp_server/__init__.py,sha256=u5VyiO3beS875PBflORPjfQPUa57WihSs7aisJLlXkU,85
2
- nia_mcp_server/__main__.py,sha256=XY11ESL4hctu-BBgtPATFZyd1o-O7wE7y-UOSoNs-hw,152
3
- nia_mcp_server/api_client.py,sha256=6QFUg6jI9m0EAMrGm-HEAU5uYsUUxzhRau0iLCW9fpU,25815
4
- nia_mcp_server/profiles.py,sha256=2DD8PFRr5Ij4IK4sPUz0mH8aKjkrEtkKLC1R0iki2bA,7221
5
- nia_mcp_server/project_init.py,sha256=T0-ziJhofL4L8APwnM43BLhxtlmOHaYH-V9PF2yXLw4,7138
6
- nia_mcp_server/rule_transformer.py,sha256=wCxoQ1Kl_rI9mUFnh9kG5iCXYU4QInrmFQOReZfAFVo,11000
7
- nia_mcp_server/server.py,sha256=CuXj-YWd4QHhhE5v_hEGHWGalO3whVlFUOMK359vqgs,75827
8
- nia_mcp_server/assets/rules/claude_rules.md,sha256=HNL5GJMUbFxSpNbIAJUQWqAywjMl4lf530I1in69aNY,7380
9
- nia_mcp_server/assets/rules/cursor_rules.md,sha256=hd6lhzNrK1ULQUYIEVeOnyKnuLKq4hmwZPbMqGUI1Lk,1720
10
- nia_mcp_server/assets/rules/nia_rules.md,sha256=mvdYrkoiRgxeROhtnRXCV53TX5B9wqLiCJ6oYTqSPfY,6345
11
- nia_mcp_server/assets/rules/vscode_rules.md,sha256=fqn4aJO_bhftaCGkVoquruQHf3EaREQJQWHXq6a4FOk,6967
12
- nia_mcp_server/assets/rules/windsurf_rules.md,sha256=PzU2as5gaiVsV6PAzg8T_-GR7VCyRQGMjAHcSzYF_ms,3354
13
- nia_mcp_server-1.0.12.dist-info/METADATA,sha256=zpdgFJZ99Rm3AI_WUnBXg2aNCPem0HCDvHNuYf-JZDg,6767
14
- nia_mcp_server-1.0.12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
15
- nia_mcp_server-1.0.12.dist-info/entry_points.txt,sha256=V74FQEp48pfWxPCl7B9mihtqvIJNVjCSbRfCz4ww77I,64
16
- nia_mcp_server-1.0.12.dist-info/licenses/LICENSE,sha256=IrdVKi3bsiB2MTLM26MltBRpwyNi-8P6Cy0EnmAN76A,1557
17
- nia_mcp_server-1.0.12.dist-info/RECORD,,