@@ -2,6 +2,8 @@ package cmd
2
2
3
3
import (
4
4
"fmt"
5
+ "os"
6
+ "path/filepath"
5
7
6
8
"github.com/hashicorp/go-hclog"
7
9
"github.com/spf13/cobra"
@@ -12,40 +14,17 @@ import (
12
14
var identityCmd = & cobra.Command {
13
15
Use : "identity" ,
14
16
Short : "Manage MCP server identities" ,
15
- Long : `Manage AGNTCY-compliant identities for MCP servers.
16
-
17
- Identity support is optional and disabled by default. Enable with:
18
- export MCPD_IDENTITY_ENABLED=true
19
-
20
- Identities follow the AGNTCY Identity specification:
21
- https://spec.identity.agntcy.org/docs/id/definitions` ,
22
17
}
23
18
24
19
var identityInitCmd = & cobra.Command {
25
20
Use : "init [server-name]" ,
26
21
Short : "Initialize identity for an MCP server" ,
27
- Long : `Initialize an AGNTCY-compliant identity for an MCP server.
28
-
29
- This creates a development identity with:
30
- - DID format: did:agntcy:dev:{organization}:{server}
31
- - ResolverMetadata with assertion methods
32
- - Service endpoints for MCP
33
-
34
- The identity is stored in ~/.config/mcpd/identity/{server}.json` ,
35
22
Args : cobra .ExactArgs (1 ),
36
23
RunE : func (cmd * cobra.Command , args []string ) error {
37
24
serverName := args [0 ]
38
25
organization , _ := cmd .Flags ().GetString ("org" )
39
26
40
- // Create logger based on verbosity
41
27
logger := hclog .NewNullLogger ()
42
- if verbose , _ := cmd .Flags ().GetBool ("verbose" ); verbose {
43
- logger = hclog .New (& hclog.LoggerOptions {
44
- Name : "identity" ,
45
- Level : hclog .Debug ,
46
- })
47
- }
48
-
49
28
manager := identity .NewManager (logger )
50
29
if err := manager .InitServer (serverName , organization ); err != nil {
51
30
return err
@@ -59,8 +38,5 @@ The identity is stored in ~/.config/mcpd/identity/{server}.json`,
59
38
func init () {
60
39
rootCmd .AddCommand (identityCmd )
61
40
identityCmd .AddCommand (identityInitCmd )
62
-
63
- // Flags for identity init
64
41
identityInitCmd .Flags ().StringP ("org" , "o" , "mcpd" , "Organization name for the identity" )
65
- identityInitCmd .Flags ().BoolP ("verbose" , "v" , false , "Enable verbose logging" )
66
42
}
0 commit comments